| |||||||||||||
| |||||||||||||
InfoNews
What and why
Solution
Scenarios
Backdoor!
Tips&Tricks
Future
Links
It is fun in itself afterall
Last Updated: Thursday 25th of April 2002 Having any remarks, questions, problems or insults you can contact me
here: massena@wp.pl
| |||||||||||||
Here is long delayed story. First I want to say that it is not the lecture for everybody (except maybe Bonus Gallery ?) - and not only because horrible language (but that too :). You will not find there "Canned Solution" - it is not a list of instructions to follow to the letter - it is rather description of "an experiment". Having enough time and will you should be able to repeat most of that experiment (feel free to email me with any questions or remarks: massena@wp.pl). In exchange you will get the ability to play through ANGV engine a number of existing Waterloo scenarios. However ANGV release seems to be about (more or less) a month apart, WNLB Patch should be out quickly after so I personally think that ability in itself (despite all the fun and time I spent testing/playing scenarios) is not worth the effort. The true benefit of that story is for me its educative value. At the beginning my intention was just checking how well (if at all - it turned out to be the valid question) the MultiCampaign feature of ANGV is really working. I've choose the Waterloo as good, ready to use test case. In the process I've learnt (and tried to describe) quite a few facts about ANGV engine (as it is in its current Demo incarnation) internals. Some of them may be useful on their own. Is it possible to prepare such "canned", "ready for sale" solution? I think it is possible to come quite close to it. There are few things which would need to be done (and can be done) better then I've did for my testing purposes. Still there are also some inherent limitations (uniforms) and at least one severe (though not critical) problem (see Battle Aftermath for more info about it). Because the size of the story got out of my control I decided to divide it into sections to make reading a bit easier. Here is a list of sections - please, don't treat their headings too serious :-)
That part was originally posted (05.04.02) on the Scenarios section. I have taken time to check if / how using Campaign different then default ( Campaign=2, value of 1 is apparently reserved for
Waterloo) work. I choose value above reserved range (i.e. above 20),
create corresponding CONFIG44.CFG and decided to
take optimistic appoarch - using whole Waterloo map/oob/scenario pack.
Didn't load correctly (of course ;), so I started to replace Waterloo
elements by Austerlitz ones. Still didn't work... Switching to pesimistic
path - tried to load Austerlitz orginal map data, original oob and
everything else through the Campaign key
different then default - did not work either !!! Was enough for me so I
had started debugger to see what inside. It looks like during loading fog
file for Austerlitz (and only for it) is called small piece of code which
initiate some variables to non-zero state. For other Campaign settings that code is not called (note that
for Waterloo no fog data is loaded at all yet for settings above reserved
engine IS trying to load fog file - default name is NAPFOG44.RAW in my case. You can change it using FogFile property in config file. There are also FogStart and FogEnd
properties - to define time limit for the fog?). Looks like a bug to me
(but it is hard to judge without source code - so it may turn out to be a
feature at the end :-). Result is "DIVIDE BY ZERO" exception in the load
process. Hope it will be cleaned before the release. For the moment I had
patched quickly the code so I managed to load orginal Austerlitz data as a
custom campaign (big deal isn't it? :). Still something was looking
strange... No lighting, no sunny heights, no valleys in the shadow - it
was like during the cloudy day just before the thunderstorm - otherwise
everything seemed to be OK and playable. My theory is that lighting
conditions are defined in the set of AUSTERMAP_00HH.RAW files in the GRAPHICS folder. It is
backed up by the fact that removing that files results in the very same
cloudy sky when loading Austerlitz standard way. Do the HH numbers mean
the hour of the day (and night)?
So here is the situation: We are using Austerlitz original OOB/SCN files. Still loading (through Multi-Campaign feature) full set of Waterloo MAPDATA files results in the quick bumping-out. When Terrain and Buildings files are "dotted-out" everything loads and plays OK. One more check and it is clear now: terrain is broken! That is parts of the Terrain file contain broken elements - it is enough to scroll (or zoom-out) map a bit - when they are supposed to appear in the camera's view failure is inevitable. Probably easiest way to handle that problem would be to check if WaterMap.BAG taken from WNLB would help. I've taken more complicated way (don't ask why, please :). I started (using block Copy&Paste feature of my editor) to copy step-by-step parts of the original WaterlooTerrain.txt to the initially clean Terrain file. Here is what I've found missing:
Certainly much more can be said (and done) regarding terrain and terrain features. We may see soon updated version of the MAPCREATION.txt file so it seems reasonable to wait until ANGV release.
Having Terrain file worked out to some degree it is the time for Buildings. Using original WaterlooBuild.txt does not cause crash. That is good but still there is a lot to be done. I want to leave the Hougoumount for later as it is issue in its own right. Most of other fortified buildings are missing too (except the white flags, that is), oddly enough the La Haye Sainte is in its place but... in the form of Sokolnitz Castle. Also the barricade on the road ahead of La Haye Sainte is missing. Going in reverse order:
25.04.02SUPPLEMENT: TERRAIN and BUILDING FEATURES REVIEW:
So now we have (almost) all Waterloo map assets ready to use and it is time for switching from Austerlitz OOB and SCN files to the Waterloo ones. I was quite optimistic in that moment thinking there should be no real problem with it. That is I expceted (of course) to see riderless horses and firing Standards and total mess in the uniforms (and hats) whenever dispalyed at all - but nothing more. As usual I've used L'Arme Blanche as testing scenario. At the beginning things were going as expected: sabres were sharp, artillery strong, many horses lost their riders before fight started. In the middle of the fight however scenario bumps-out to the main screen. I repeated the test a few times with the same results. Apparently this time it was not because of the terrain. It takes me some time to realize that it was connected to the moment when French reinforcements arrive. Tweaking with SCN file I was able to isolate the unit(s) which wreaked havoc. It turned out that only light cavalrymen (hussars) are guilty. Why other (French and British) units did not make troubles? Hussars had assigned uniform ids (54 and 51) higher then Dragoons and Cuirassiers. Could it be the reason? BTW why some units have cavalry stands (wrong of course) displayed at all.? Since all Waterloo uniform ids are below the range of ANGV ids (that is below 100) all units should be phantom-like... Apparently there was the time to dive into the process of uniform loading. At the beginning I thought that process is somewhat similar to the scenario loading: program scans some folder (bag file in case of uniforms) looking for all the files in form of xxxCAVSTAND.BMP, yyyMARCH.BMP etc., where xxx, yyy can be any number from the wide range (say something between 100 and 200 :). That would allow easy addition of new uniforms; would be enough to put newly created bitmap in right format into BAG file and then assign its number to the unit(s) in the OOB file. Man!- I'couldn't be more wrong. The ranges available for cavalry, infantry, artillery and leaders uniforms are very narrow and all existing slots are already used up. Sounds strange at first but the number of uniform slots for infantry in ANGV is smaller then in case of WNLB. Waterloo is winning 15:8 in that category. For cavalry there is almost perfect deuce. Is ANGV step back comparing to WNLB? Why it is not possible to have more slots free for use for custom campaigns and for enhancing Austerlitz campaign? It takes me some time to find resonable (I think) explanation. My only excuse is that I'm not DirectX specialist nor had I anything in common with game development (until now that is - just joking of course :-). The likely answer is PERFORMANCE. Reasonably good speed of rendering frames for screen refresh is crucial for game engine. That depends on the speed with which all the necessary sprites are scaled down and blitted into display surface. For most video cards the speed of blitting within the limits of internal video memory is orders of magnitude higher then speed of blitting between main and video memory. So the serious limitation is the size of video memory available for sprites. Some caching techniques may help, still best way is to limit total size of the sprite bitmaps trying to fit as much as possible into video memory. Part of uniform bitmaps in ANGV (especially infantry ones) are more detailed then in WNLB: there is more steps of animations; also there is no melee action bitmap in WNLB at all. So it looks like trying to fit into preset memory limit ANGV trades part of infantry uniform slots for better animation quality (there were some complaints about "cartoon-like" quality of animations in WNLB). Raising of memory limit for sprites would probably be possible but would mean also raising hardware requirements. Of course all that is pure quessing. Is there seed of truth in that reasoning we may see when WNLB Patch 3 is available. It is now high time to finish with this digression and come back to reality. Looking into uniform sprites handling inside ANGV I found out that uniform ids lower then 100 are adjusted to the range suitable for ANGV (id > 100). That explains why some units have any (virtually random) uniform displayed. Most original Waterloo uniform id+100 fit the range of uniforms defined in ANGV. For some of them there are no uniform bitmaps in the ANGVDemo WaterArmy.BAG - these will be well-known ghost units, others are lucky enough to get some (usually odd) dressing. What with ids outside of the ANGV range? That is the case of the French Hussars. Their id (54+100) is outside the range of ANGV cavalry stands. Looks like it is enough to cause access violation and crash scenario. Oddly enough it is not the case for commander uniforms. Many ids are in that case outside of the leader bitmaps' range too. I guess the code is more fail-safe here (but didn't check it really). In fact the cavalry stands between 51-56 may be the only ones causing troubles. French infantry (ids > 8) get uniform 108 (white!) - looks odd but works. For my own purpose I decided to do remapping of the uniform/hat ids in the batch mode. I've written PERL script (PERL is my favorite choise for the text-processing tasks like this) which do the job based on input criteria defined in the text file. I have limited myself to rather simple mapping: separate uniforms/hats for light and line infantry, heavy and light cavalry, infantry and cavalry commanders. I wanted to be certain that all units on both sides got assigned correct (and resonable looking) uniforms and hats just to be sure that any following crashes would be not connected with uniform issue. Also for the time being I removed all references to the leader portraits (all replaced by -1). Good news is that it was enough to play not only the small scenario like L'Arme Blanche but also "playtesting" a bit (not up to the gory end of course) version of the full battle scenario (I've used Duke of Richmond custom version known as Waterloo: Glory Enough For All. More about my impressions later) The mapping mentioned above leaves a lot to be desired (lack of red coats is particulary severe :). Unfortunately renaming and direct copying of Waterloo uniform bitmaps is not feasible. The layouts of bitmaps differs, also in many cases ANGV bitmaps contain more sprites. It is certainly possible to reuse Waterloo sprites by copying them piece by piece (that process can be even somewhat automated). Holes can be filled by using the same Waterloo sprite more then once (at a price of reducing animation quality). Still there is a problem of infantry melee action bitmaps (with difficulty melee bitmaps can be recreated using Waterloo sprites from run bitmaps). But even if somebody would use all means available and adapt all Waterloo uniforms to ANGV still such ultimate solution would have to be suboptimal. As said above there is not enough slots in ANGV for all Waterloo (infantry) uniforms - some units would have to lose their beautiful dressing. In any case there is space for improvements in that area. Looks like AI general "thinks" a bit differently in ANGV then in WNLB. As a result in that scenario it (he?) decides to switch to defensive posture. Instead of attacking Hougoumont French brigade march away to take position somewhere around Mon Plaisir. On British left same situation: Frenches are attracted by Plancenoit and just don't care about Papelotte. Removing all French controled VP sites will help to restore their courage. Of course some kind of fine-tunning would be preferred. Maybe that will help: "Hey Frogs! Come back, stand up face to face with us and fight like men! Don't run away like cowardly... frogs!"
All the testing described until now was based on the MultiCampaign functionality as described in the MAPCREATION.txt. As far as I can tell there is the bug in the Demo which prevents direct using of that feature. I've got it working by applying quick&dirty patch. As a side effect (?) of that patch scenarios loaded in Campaign different then default are loosing right daylight conditions. They are playable but look a bit depressing :(). There is possibility to correct the bug by recoding Campaign configuration routine (another, more sophisticated patch) but it is wise to wait for the release version first - the bug may be already corrected there. There is also another, more brute-force approach to the issue of loading custom maps (campaigns) into ANGV (or WNLB for that matter). It is almost as simple as overwriting the original ANGV OOB, SCN and MAPDATA files (and GRAPHICS bags if needed) by the versions prepared for custom campaign. To accommodate to the different map dimensions small intervention into ANGV executable is still desirable. In that case changing two bytes is all what seems to be needed - simple HEX editor should be enough. Here are the "magic" numbers for ANGVDemo: offset=04AEAFB(hex) original=07D(hex) - to be replaced by your map X-dimension offset=04AEB0F(hex) original=096(hex) - to be replaced by your map Y-dimension Note that for Campaign <> 2 map dimensions provided in CONFIG file are adjusted to the range 32 < GameMap{X,Y} < 320 so it is wise to keep yours map within that range. In fact MAPCREATION.txt mentions 256 (255?) as maximal map dimention. Until now I did not test ANGV against any of the limits - anyway Waterloo map dimensions poked in the offsets provided works OK. Another important remark is that these numbers (offsets) are highly version specific. Method should work for release version of ANGV too, but offsets will certainly differ. Moreover the same should be possible for WNLB. In that case the offsets will be different for each WNLB patch version (In WNLB Demo 049F827hex for X-dim and 049F83Dhex for Y-dim should work - but be careful as I didn't have time to really check it!). Worth to note is that in WNLB size limit against which map dimensions are tested is indeed equal 256. It may mean that abilities of ANGV were extended and it is really able to handle maps nearly as big as 16x16km (is it 10x10 miles? - always have troubles with these strange measures :-) [Actually looks as if currently the largest map which can be loaded properly into ANGV Demo is 256x320 squares. For more details see the UPPER LIMIT FOR MAP DIMENSIONS IN ANGV tip] 25.04.02 There is one another thing which may (theoretically at least) generate some unexpected effects when using the brute-force appoarch. As we know for Campaign=2 engine loads AusterlitzFog.RAW as fog file. That file seems to have the format similar to other MAPDATA files. Obvious difference is that it is binary file whereas other are text files. Yet like other files it is byte matrix with dimensions corresponding to the size of the map. In AUSTERLITZ case it is 125x150 which equals 18750 bytes - exact size of AusterlitzFog.RAW. For custom maps fog file should in theory be adjusted to the new map size. However I did not notice any problems with AUSTERLOOTM and Waterloo map (or two other maps with yet another dimensions). In fact I do believe that (because of the way it is handled internally) the file left intact would work peacefully with any map. Still it is very possible that in that case you will see in one of your morning scenarios full-scale fog effect. I did achieve such result (see the picture below) when loaded one of Waterloo scenarios with hours put back to early morning. To avoid that side effect it seems to be enough either to remove the fog file altogether or (more elegant) create custom fog file (preferably of right size for given map) with all bytes set to zero. Note however that what in one case is side effect in another may be very welcome feature: if you need to recreate morning fog effect on part of your map now you can prepare your own fog file (well, fully-fledged map editor would be of great help here. Maybe in the future...). For full utilisation of the feature would be good to know how to define time limits for fog. Looks like FogStart, FogEnd properties are read from CONFIG file but then ignored (hmm? I need to check it again...). That would mean that fog time boundaries are now hardcoded. FOG COVERS WATERLOO BATTLEFIELD
Comparing two different roads to AUSTERLOOTM I'd like to
say that MultiCampaign way is potentially much
more flexible and promising. Currently it demands to apply tricky code
patch and does not support daylight conditions - instead regardless of the
time of day fight goes on in the semidarkeness. These faults however may
be corrected in the release version making that way the preferred method.
Main advantage of the brute-force way is that it is available right now. It is also relatively easy to use (even though it also demands pokeing into executable file). On the other hand it is rather disc space hungry and hardly can be called elegant. La Haye Sainte region. From left: 1. "semidarkness" - no daylight applied at all 2. AUSTERLOO at evening 3. AUSTERLOO about noon (remember that it is December noon) 4. Waterloo original (note also seasonal differences). Due to the shortage of disc space on my web account and 'cause I wanted to post a few new pictures I had to (temporary?) give full-size pictures up. I hope the thumbnails are in that case enough to demostrate the difference between daylight conditions...
Is the proposed solution for Waterloo@ANGV issue perfect? Definitely not. Is it good enough? Was it worth the efforts? It is another question. My personal answer is that - taking into account incoming ANGV release and following after it WNLB Patch - the ability to simply play a few Waterloo scenarios through ANGV right now would rather not be worth all that time invested. Not that it was no fun - it was! In fact I wasted much too much time "playtesting" myself or observing the course of battle between "friendly" and "foe" AI generals. And I'm still going to waste a bit more :-). The real, long-lasting gains are twofold: first in the process I gathered a number of interesting insights regarding ANGV and its internals. Some of them already resulted in (hopefully) useful hints (PHEASANTRY tip, Artillery tip) others may find its application in the next ventures. Second and for me most important and promising is that the experiment described may be treated as the evaluation of ANGV' suitability as an engine for future custom-made campaigns (aka battlepacks). There is so many battles/campaigns deserving attention that BAG company itself will definitely not be able to cover all on its own. I personally will probably not be able to create such campaigns alone but hope to see (and help when possible) others in that process. From that point of view Waterloo@ANGV is just case study. Afterall using Waterloo as a test case with its maps, scenarios, OOBs and graphics - all ready to use - was rather obvious choise. There are still few minor to severe problems and couple of things "yet-to-be-done" later. Some of them were already mentioned above but here is a full list as I see it at that moment:
Right now however I gonna take a break: enough is enough :). 25.04.02YET ANOTHER MAP TO
EXAMINE THE ENGINE
Below is series of pictures from Feldmarschall Vorwaerts scenario. Battle was played in AI-vs-AI mode. My whole participation (on the Prussian side) was sending a few orders at the opening stage of battle. Note that a result of my laziness is that none of the forty Prussian cannons had taken part in the battle. In my opinion the style in which AI generals are (non)commanding their artillery is currently below medicore level. [OK. Lets face it! Gneisenau is saying it is my fault because I did not send detailed orders to individual batteries. True, but didn't I send the "Vorwaerts!" order to everybody? - I did! I think I should punish few artillery commanders to set a good example... Or maybe should I execute Gneisenau? - he is growing more and more insolent. For the meantime: "Vorwaerts!". :-)] Opening stage. Formations marching to their deployment positions. There are two attack directions. At first all seems to go well despite the single enemy cavalry roaming in open field. Success is close! Enemy cavalry did wreak some havoc but it did not stop advance and deployment of our forces. Both at Plancenoit and near La Cote Haute enemy is outnumbered and nearly broken. New enemy cavalry changes the odds near La Cote Haute. Our first attack is broken. Brigades of second wave must start from scratch. Note single enemy cavalry regiment slowing down our second wave (at least 2 brigades) marching to expand first success at Plancenoit. Meanwhile Nappy brings in French reinforcements to restore the situation in that area. At La Cote Haute our forlorn infantry take heroic efforts to push back enemy cavalry supported by artillery. At Plancenoit our infantry once again is trying to seize the town. French are counter-attacking with bayonets! Success: La Cote Haute taken! Enemy forced to retreat. But the French threw out our infantry from Plancenoit town. Firefight north of Plancenoit Church is growing in strength. Some of our battalions start to waver. Frenches try to deliver decisive blow going once again on bayonets... but are forced to pull back! Both sides are exhaused, majority of units is demoralized and unable to engage enemy. The intensity of battle is declining. Night covers bodies of killed but makes the moans of wounded even more horrifying. It is time to count casualties and bring back some order in ranks... above all Ordnung muss sein. |