Build for improved obstacles positioning

This version is not for general testing, many things are half-done. It’s special a build for **Ivan ** :slight_smile:
Tow Dragon has implemented shifting obstacles mechanism. It’s realized through config/obstacles.txt - in each entry last two numbers are (x,y) shift coordinates. They need to be adjusted. You’ll have to run VCMI, enter into battle and check obstacles positions. Then correct shift values, until they fit battlefield well.

To make your work faster, I’ve added two little tweaks to VCMI_server:

  • allowed terrain information is ignored, all obstacles are treated as allowed
  • remarkably increased obstacles quantity (over 50 hexes will be covered)

I’ve also attached original server version without that tweaks (VCMI_server_orig), you can replace the tweaked file with it to use it.
This build has also elements of support for sieges, you can check how walls (placed using your info) look in game :slight_smile:

(hope it’ll work, if anything is wrong, let me know)
Old savegames are not supported and most likely will lead to disasters. Clean your Games/ subfolder before running this build.
vcmi_073b.7z (1.98 MB)

Thanks. Works as expected. I think I’ll finish this in a week time (or even faster). Summer is over, so I’ll have less free time.
There is TOO many obstacles, so it is difficult sometimes to determine blocked tiles for each of them. But I still need to check this config in original build (I’ve found some errors in allowed terrains config)

Great! :slight_smile:

Blocked tile info is in the ERM Help: h3maparchives.celestialheavens.c … /erm_help/
(more precisely here: h3maparchives.celestialheavens.c … ver_bf.htm )

Problem is not “how” they are placed, but “where” - it’s difficult to find out whether obstacle placed half-tile left or half-tile right in such sea of statics.
Using original server “fixed” problem
ATM I’ve fixed all magical terrains obstacles:
img171.imageshack.us/img171/3698/obstacles.th.jpg
Obstacles placed as needed, but I have some graphical bugs((

I’ve extracted all OB* files from resources, and found in H3bitmap.lod some unused in VCMI obstacles: OB**L00.pcx
I don’t know should I add them to list or not (they located in another .lod, in .pcx format but not .def)
if yes: should I do anything except give them new ID and place in alphabetical order?

Do you really think they’re real obstacles?
maybe it’s just similair naming convention?
Oooor maybe it’s some beta/alfa thing such as breathing anims?
Ooor they’re normal obstacles but copied from older heroes?
maybe could you post contents of three of these?

PS: But maybe they’re injected by WoG instaler? It looks like they’re obstacles for scripted battles or unused wog resources? or from some wog mod?

PS2: Wait! if they third letter is J (or somewhat other not matching) then they’re probably not obstacles !!! anyhow post examples here…

EDIT: or maybe they’re imported from other game (maybe wog injection maybe not) so they have their original form?

EDIT:
@UP
On the picture i see that monsters and obstacles need layering… maybe draw them regardlessy obstacle or unit starting on topmost row and ending on bottom row?

Wow. That’s a lot of thoughts. Let’s begin:

Yes. I’ve made screens with them in H3 wog. They are present there (all-in-one + extra battlefields)
I’ll make fresh install of H3 and check this again.

Some of them are just a bit different name of already used, but not all of them.
They are present in H3 WOG and looks fine
Do you mean heroes 1 & 2? No. Some of them made for magical terrains (new feature of SoD or AB)
See attachments (screens from H3 (with same name like in bitmap.lod))
Maybe, but “VCMI Project - Heroes 3: WoG recreated” so, everyone should have them as well

5th letter is L in most of them (I think L=Large, most of used obstacles have S=Small and are definitely smaller than this ones)
Fits heroes well. I don’t think so… (and I have no mods except WOG)

This is one of the reasons why I posted it

Edit: Installed Heroes 3 : this part of bitmap.lod is not modified by WOG at all

BTW: there is one more minor bug on the screen above: you can select column where battle machines are placed
newobstacles.7z (223 KB)

OK. Most of work is done:
1)Obstacles position - should be 100% fixed.
But I have problem with OBGRSO3.DEF:
when game starting battle with it VCMI crashed. (It have dublicated ID in config -> completely “invisible” in VCMI, after changing ID - crash on starting a battle)
Everything else should be fine.

2)Obstacles blockmap: should be 100% fixed

3)Allowed terrains: I’ve fixed only major errors (like crosses from “holy” on on “cursed” battlefield) but it still can have smaller errors. I’ll leave it as it. (just don’t know precise way to fix it)

4)Obstacles from bitmap.lod - currently VCMI almost have no cliff-obstacles (but H3 have plenty of them). Most of them are stored here and as result unused in VCMI. But I can’t add them to obstacles.txt at the moment (crash on starting battle).
I’ll be able to add them as soon as you fix this crash (about 30 new pics to VCMI)

Attaching config. Test it please.
obstacles.zip (1.54 KB)

I’ll try to fix it. When I was writing code handling obstacles, I didn’t know that they can overlap (most of them actually do not overlap…)

Just leave it as it is. They are not implemented.

Actually it’s just a misspelling (the proper name of this obstacle is OBGRS03.DEF, it ends with zero three, not O three). But where did you see the second entry for this obstacle? In my config it’s present just once with ID 35.

That’s great, thanks.

In the header you have list of all terrains in the game, every of them has a certain number between 1 and 25. Every obstacles has in its description a sequence of 25 0’s and 1’s - 1 in i-th position means that this obstacle can be placed on terrain with number i (ie. OBBDT01.DEF has 1 on position 23 and therefore can be placed on rough). In file config/battleBack.txt you have 25 names of backgrounds for battlefields - as one can expect, i-th name is the name for i-th terrain, in our example rough has backgound CMBKRGH.BMP. By comparing obstacles and backgrounds, you can match them (just in case you would like to do this too, you have already made a lot for VCMI).

I’ll try to add it but I don’t know when.

rev 1181 has one line less in obstacles.txt than earlier revisions :unamused:

Actually in previous revisions obstacle with ID 16 had two entries. In 1181 second one of them has been removed.

in the version from 1st post:
@Tow dragon
line 53 and line 100 - same id (35)
@majaczek
line 103 and line 104 - same .def (OBSWS11B.DEF)

Allowed terrains: I know how to import this data in vcmi (I’ve already fixed major errors) but i don’t know precise way to export it from H3 except making huge number of screens in H3 and think whether you found all available for this background.

But if ask testers to report this kind of bugs this can be finished quite fast :wink:

I think it’ll be enough for now to make it look reasonable - ie. no clovers on rough terrain etc. It does not have to be exactly like in Heroes 3.