Cossacks 1 - Sight range of fences and stone walls
|
|
Ftoomsh | Date: Monday, 13/May/2013, 11:15 AM | Message # 1 |
Count
Group: Modders
Messages: 124
Status: Offline
| Does anyone know how I can reduce sight range of fences and stone walls to a genuine zero? I used the command;
VISION 0
But this is an index of 0 to 8 and even at zero fences get a sight range that fills the screen pretty much. I want the sight range of fences and walls to just show the fence or wall basically and nothing else. After all, fences and walls dont have eyes.
I am willing to accept that buildings have sight range because of civilians inside but lást time I checked nobody lives in solid wood and solid stone fences.
Actually, I can tell a funny story too. I invented the "entombed drummer". I wonder if I was the first? You build a section of stone wall over a drummer thus trapping him. Then you get more sight range than the wall would give and the drummer can't be shot. However, this is dirty tactics. Dont use it in a game.
When I invented exploits like this I used to tell my olf OC clan and then we would agree to ban them.
|
|
| |
EbelAngel | Date: Monday, 13/May/2013, 4:44 PM | Message # 2 |
Site Administrator
Group: Administrators
Messages: 996
Status: Offline
| Quote (Ftoomsh) Actually, I can tell a funny story too. I invented the "entombed drummer". I wonder if I was the first? You build a section of stone wall over a drummer thus trapping him. Then you get more sight range than the wall would give and the drummer can't be shot. However, this is dirty tactics. Dont use it in a game. Lol!
I'v never tried or really looked in to this but perhaps following things that come to mind:
1). Walls may be differently treated as other buildings, it has a separate file somewhere ( wall.lst? ) , perhaps see if anything is in those files.
2). Try using a negative value? Eg. VISION -1 ( im not sure a negative would work here, but it does work for some things)
3). Delete the line VISION all toghether, either it wont have any view at all then or it will revert to the default settings taken from the engine itself ( in case that VISION has been set to default). I can look it up if you like but perhaps first try and see what it does.
Let me know if any of the above helps at all.
|
|
| |
Ftoomsh | Date: Sunday, 19/May/2013, 4:52 AM | Message # 3 |
Count
Group: Modders
Messages: 124
Status: Offline
| Nope, I am afraid that does not work. I get the error message;
VISION: Argument must be 0 - 8.
There's the problem. Zero sets the minumum vision of a building and it still about fills the screen with vision (dispels fog of war). I want wood fences and stone walls to give either no vision or just a tiny bit so you can just see the wall maybe.
On another issue, does anyone know these answers?
1. How to create a new unit and get the game to recognise it? 2. How to add a cost to a unit that does not have that cost. For example Grenadiers in my rebalancing Mod of OC Mod cost;
PRICE 2 FOOD 140 GOLD 85
I tried to add Iron as follows;
PRICE 3 FOOD 140 GOLD 85 IRON 20
But the engine did not like it. Said the iron was an unknown resource for file GRE. So somewhere else it must define what resources are needed for Grenadiers. Anyone know?
Thanks in advance.
|
|
| |
EbelAngel | Date: Sunday, 19/May/2013, 2:57 PM | Message # 4 |
Site Administrator
Group: Administrators
Messages: 996
Status: Offline
| Quote (Ftoomsh) PRICE 3 FOOD 140 GOLD 85 IRON 20 This should work. It doesn't require any other definition then in the MD file itself.
Show me the file itself please. And how are you packing this up? patch01, mod01,...?
Quote (Ftoomsh) 1. How to create a new unit and get the game to recognise it? 1. Add the GP files 2. Add the MD file 3. Add the MD FILE name to MDLIST.txt 4. Add the MD FILE name to nmlist.txt 5. Add the MD name to the NDS file under [MEMBERS]and [COUNTRY]. These 2 are the minimum to show up in the editor. More entries will be needed ofcourse under [ENABLED], [FIXED PRODUCE] etc.
This seems easy but a lot of things can go wrong here. It has to be exact.
For example: The MD FILE name in MDLIST.txt has to be in CAPS. NmList.txt doesnt have to be in caps but it is however case sensitive ( Eg. "SwzMch" is not the same as "swzmch") The MD name in the NDS file is not the same as the MD FILE NAME, it's the name inside the MD file name that goes in the second column under MEMBERS. Its highly adviced you use the same name everywhere so you cant make mistakes there.
When adding a unit the NDS file to COUNTRY section, dont forget to increase the number on top by 1.
Aswell as pay attention to for example how you repack the files into mods/patch. If i'm not mistaken, nmlist and mdlist is found inside a folder TEXT/. So those would have to be renamed to TEXT+nmlist.txt eg in order to put them back properly. I'm not entirely familiar with the OC mod file/folder structure so do verify that you put them back properly.
Do tell me what unit you are trying to add, perhaps show me the files itself or mod.patch. You can pm me if you feel unconfortable uploading them here in attachment, but there's no substitute for actually seeing the files to determine what goes wrong.
Hope that helps.
Regards.
EDIT:
The VISION thing is certainly engine driven. I looked it up:
Code NewMon.CPP
if(Line0==Line) if(!strcmp(gx,"VISION")){ z=Gscanf(f1,"%d",&p1); if(p1<0||p1>8){ sprintf(gy,"%s, Line %d :%s: Argument must be 0..8",name,Line,gx); ErrM(gy); }; if(z!=1)IncPar(name,Line,gx); VisionType=p1; NLine(f1); Line++; }else FOG.CPP
void FogSpot(int x,int y); int GetHeight(int x,int y); void UnitLight(OneObject* OB){ //return; if(!OB->Ready)return; int xx=OB->RealX>>4; int yy=OB->RealY>>4; int rr=200; int rr1=rr-(rr>>2); yy-=(GetHeight(xx,yy)<<1); NewMonster* NM=OB->newMons; switch(NM->VisionType){ case 0: FogSpot(xx,yy); break; case 1: FogSpot(xx+128,yy); FogSpot(xx-128,yy); FogSpot(xx,yy+128); FogSpot(xx,yy-128); break; case 2: FogSpot(xx+128,yy+128); FogSpot(xx-128,yy+128); FogSpot(xx+128,yy-128); FogSpot(xx-128,yy-128); break; case 3: FogSpot(xx+2*128,yy); FogSpot(xx-2*128,yy); FogSpot(xx,yy-2*128); FogSpot(xx,yy+2*128); FogSpot(xx+128,yy+128); FogSpot(xx-128,yy+128); FogSpot(xx+128,yy-128); FogSpot(xx-128,yy-128); break; case 4: FogSpot(xx+3*128,yy); FogSpot(xx-3*128,yy); FogSpot(xx,yy+3*128); FogSpot(xx,yy-3*128); FogSpot(xx+2*128,yy+2*128); FogSpot(xx-2*128,yy+2*128); FogSpot(xx+2*128,yy-2*128); FogSpot(xx-2*128,yy-2*128); break; case 5: FogSpot(xx+4*128,yy); FogSpot(xx-4*128,yy); FogSpot(xx,yy+4*128); FogSpot(xx,yy-4*128); FogSpot(xx+3*128,yy+3*128); FogSpot(xx-3*128,yy+3*128); FogSpot(xx+3*128,yy-3*128); FogSpot(xx-3*128,yy-3*128); break; case 6: FogSpot(xx+5*128,yy); FogSpot(xx-5*128,yy); FogSpot(xx,yy+5*128); FogSpot(xx,yy-5*128); FogSpot(xx+4*128,yy+4*128); FogSpot(xx-4*128,yy+4*128); FogSpot(xx+4*128,yy-4*128); FogSpot(xx-4*128,yy-4*128); break; case 7: FogSpot(xx+6*128,yy); FogSpot(xx-6*128,yy); FogSpot(xx,yy+6*128); FogSpot(xx,yy-6*128); FogSpot(xx+4*128,yy+4); FogSpot(xx-4*128,yy+4*128); FogSpot(xx+4*128,yy-4*128); FogSpot(xx-4*128,yy-4*128); break; case 8: FogSpot(xx+7*128,yy); FogSpot(xx-7*128,yy); FogSpot(xx,yy+7*128); FogSpot(xx,yy-7*128); FogSpot(xx+5*128,yy+3); FogSpot(xx-5*128,yy+5*128); FogSpot(xx+5*128,yy-5*128); FogSpot(xx-5*128,yy-5*128); break; }; }; NewMon.CPP regulates the MD strings and indeed show the error message you got that it has to be one of 8 arguments which is defined in fog.cpp ( see above). It states the 8 arguments based on what i believe an initial radius of vision of 200 if i read it correctly.
Ofcourse one could change this but it would mean that others units/buildings will be affected by this aswell and all MD's would probably have to be reset aswell then. I dont know, not sure if its worth all the work. Why do you want walls to have null vision anyway?
|
|
| |
Ftoomsh | Date: Monday, 20/May/2013, 2:06 AM | Message # 5 |
Count
Group: Modders
Messages: 124
Status: Offline
| EbelAngel, thanks for those answers.
1.Maybe I made a mistake when trying to add Iron cost to Grens. I will try that again. OK I did try it again and it worked. So I made a syntax error last time obviously.
2. Thanks for that info on adding a new unit. I will be using an existing unit and just renaming it and then changing some of its parameters so it should bring its graphics with it. I have added a unit to many nations diplos so I have a bit of an idea on adding a unit to nations (in the NDS file anway).
3. Yes, the walls vision thing looks too hard. I don't want to recode the engine. It's not a change I need for my rebalancing of OC mod. It was a "nice to have" not a "have to have" change. I can live with current settings.
Thanks for all your help.
Oh and another question or two;
(a) DET_RADIUS 1 200 10000 Does this mean that the unit (or formation of units) will walk towards anything hurting it, even if this thing is up to 10,000 distance units away? The 1 refers to WEAPONKIND 1 VISTREL.
OC Mod has formations that will walk towards cannon at 2000 or more range if the cannon hit them. If I forget to put my formations on hold ground, they suicide walk to a line of cannons - the fools! If I change it to DET_RADIUS 1 200 1600 they will walk to skirmishers who have a range of 1,500 (unless on hold ground) but at least will not walk to cannons hitting them from over 1600 range. Is this correct?
(a) Do you known what unit OF2S.MD (17th Officer euS) is? Do you know what nation(s) use it? If it is something Davout added you may not know.
Thanks in advance.
Oh, and I have a map question. We use random 2x land maps, open plains, for our games. Sometimes they have lakes but that is not a problem. We use lean mines so we get G3 - I2 - C2 mines around our base. Sometimes the 3rd G mine is a long way from the starting point and that is a bit of a problem. The other issue is what I call "extra" or "supernumerary" goldmines that appear scattered over the map. They each occur in a hollow in middle of four hills. Occasionally, there is a hollow that looks like it should have an extra gold mine but the mine is not there. Do you know what controls the presence and absence of these extra mines? For fairer games I would actually like all these extra mines to be absent i.e. not to have any gold mines in any of the hollows. (I do like the other extra mines in the other empty corners in a 1v1.) I don't suppose there is any way to control the extra gold mines without getting into the engine. I know I can make my own maps. That's the other solution.
I have removed geo upgrade from the 17th C in my remod and put it in the 18th C with a cost of 10,000 gold. So it takes good scouting to find mines.
ATTEMPTING THE NEW UNIT
Ok, a bit more to the story. I did all you said using the code of an existing unit in a new .MD file. I updated all the files you suggested and double-checked all your points. I even found another file you didn't mention TEXT+MOD_TEXT.TXT and updated that properly (although maybe that caused my problem). I updated some fields in the .NDS file but not all (I didn't list upgrades for the unit). So I updated its listing in MEMBERS, FIXED PRODUCE but not in ENABLED as I wanted to enable it in the 18th C. I did that in UPGRADE .. ENABLE UNITS GRP etc.
I recompiled with the Uitility Mr Nice that handles stuff like TEXT+MOD_TEXT.TXT perfectly well. I tested and got this:
Assertion failed: Could not find name for monster TURPND.MD....
AH! I just thought of something. I might have made a silly mistake. This story is to be continued....
Message edited by Ftoomsh - Monday, 20/May/2013, 11:42 AM |
|
| |
EbelAngel | Date: Monday, 20/May/2013, 11:58 AM | Message # 6 |
Site Administrator
Group: Administrators
Messages: 996
Status: Offline
| Quote (Ftoomsh) 1.Maybe I made a mistake when trying to add Iron cost to Grens. I will try that again. OK I did try it again and it worked. So I made a syntax error last time obviously. Good, glad you got it working.
Quote (Ftoomsh) I will be using an existing unit and just renaming it and then changing some of its parameters so it should bring its graphics with it. Cloning then. Shouldnt be too hard.
Quote (Ftoomsh) 3. Yes, the walls vision thing looks too hard. I don't want to recode the engine. It's not a change I need for my rebalancing of OC mod. It was a "nice to have" not a "have to have" change. I can live with current settings. I just tried changing the rr to 20 in fog.cpp. It didnt seem to affect anything on first sight in game. Probably more changes would be needed anyway.
Quote (Ftoomsh) DET_RADIUS 1 200 10000 Does this mean that the unit (or formation of units) will walk towards anything hurting it, even if this thing is up to 10,000 distance units away? The 1 refers to WEAPONKIND 1 VISTREL. If 1 is indeed WEAPONKIND VISTREL ( can be different depending on the MD's Attack type index ( weapon) then in this case the unit will fire ( vistrel) at a minimum range of 200 up to maximum 10000. I'm fairly certain though that the unit can't actually fire that far. It cooperates with ATTACK_RADIUS.
I believe the importance of this is at what point it switches from a musket to melee on certain units.
For example:
Danish grenadier,
ATTACK_RADIUS 0 35 85 DET_RADIUS 0 0 400
ATTACK_RADIUS 1 400 950 DET_RADIUS 1 400 7000
ATTACK_RADIUS 2 200 400 DET_RADIUS 2 0 5000
and
WEAPONKIND 0 PIKA WEAPONKIND 1 VISTREL WEAPONKIND 2 IADROMOR
Would suggest that if an enemy comes within a range of less than 400 of the unit , it would switch from its musket to melee and charge (unless on standground) to engage into attack untill it comes within its attack range of 35 to 85.
Notice for its musket the silly large DET_RADIUS range of 7000 whilst its real fire range is 950 as defined in ATTACK RADIUS.
Further,
SEARCH_ENEMY_RADIUS 950
Indicates that it wouldnt even 'see' the enemy past the range of 950.
I could be wrong though about what its for, it could also mean "defense radius", the distance at which it will go into attack after beeing fired upon. But that seems weird because it would mean if a building shoots this grenadier in a range of 5000 it would go an attack the building. Never seen a grenadier do that. Or its because it has conflicting ranges ( vistrel is also within 5000 < 7000 ). Still havent seen a unit like this charge a building.
There's also "ADD_ATTACK_RADIUS" . Can't remember what that is for.
I thought this was obvious untill you asked the question. It's the high values ( 5000, 7000, 10000 ) which confuse me. Then again i'v seen numbers in the MD files that have no relevance whatsoever to the unit itself, or duplicate values ,... GSC sometimes can be a bit sloppy.
My suggestion is , just try and see what happens if you do change it to DET_RADIUS 1 200 1600 and see if they still run towards the cannons shooting them.
Quote (Ftoomsh) (a) Do you known what unit OF2S.MD (17th Officer euS) is? Do you know what nation(s) use it? If it is something Davout added you may not know. It is certainly something Davout added. There's a few more of these. (OF2E.MD , OFT1.MD). All nations seem to either use the original ( OF2.MD) or one off the new one's (OF2E.MD ( england eg) ). I dont see any nation using OF2S under its member list. You know what all the other md files are or are you going trough them one by one by comparing the md, md list , nds files? Cause i probably have a file somewhere with all the md names by nation per type unit/building. Found the unused one's yet?
Quote (Ftoomsh) Sometimes the 3rd G mine is a long way from the starting point and that is a bit of a problem. Quote (Ftoomsh) The other issue is what I call "extra" or "supernumerary" goldmines that appear scattered over the map. Quote (Ftoomsh) Do you know what controls the presence and absence of these extra mines? Im fairly certain it is the engine doing this or better said the random map generator. I'v seen how it works in Cossacks 2. It uses ranges and areas at which the mines will be generated from the starting point. The random map generator is a royal mess in Cossacks I. There's some 30000 + lines of codes spread over 12 different files involved in the generation of maps. It could be hard to track it down.
Quote (Ftoomsh) I have removed geo upgrade from the 17th C in my remod and put it in the 18th C with a cost of 10,000 gold. So it takes good scouting to find mines. Seems like a good idea if you want to motivate people to scout for mines. However by the time they will have reached 18th they will have found them all and wont be using the upgrade all together. Why would anyone pay 10K gold if you found them all or just to find that one elusive mine? Might aswell delete the upgrade all together then. Right? I would use the upgrade in the 18th century just to see if i hadnt missed a mine but not at the cost of 10000 gold. I do like the idea of moving it to the 18th century to force people to scout for mines.
EDIT:
Just saw you edited your post while i was posting.
" TEXT+MOD_TEXT.TXT" is actually a file davout added to separate his new units from the existing one's. It is actually an MDLIST.txt. You only need to add it once, either in MDLIST.txt or in MOD_TEXT.txt, or you could make your very own .txt file. As long as it has : NAME.MD Description , the engine will accept it.
Did you change the NAME inside the MD file? ( As you are cloning,...) so the engine recognizes it as a 'new' unit.
Also, carefull with trying to add too many entries to the NDS file. Just get it working first in the editor ( members and country section). If that works, then move on to further adding entries in the NDS file.
Message edited by EbelAngel - Monday, 20/May/2013, 12:24 PM |
|
| |
Ftoomsh | Date: Tuesday, 21/May/2013, 2:51 AM | Message # 7 |
Count
Group: Modders
Messages: 124
Status: Offline
| Yes, I have got the new unit working thanks. I haven't tackled setting attack and defence upgrades for it yet. That looks quite complex. But the tried and tested method of copying blocks of code and changing names and parameters should work.
I will test that detection radius issue.
With mine distribution I will just have to live with it or make my own maps. A good way to make basic maps fair to all players is to take a random map that looks almost right and then just fix the "wrong" bits that make it unbalanced, like too many gold mines on one side. But then you are stuck with set nations at the start.
Yeah, I could have removed geo altogether but I kept it as a token upgrade. Believe it or not, in some of our big zero PT games that go well into 18th C, 10,000 gold would scarcely be missed. We often get 3 or 4 or even 5 gold mines to 95 miners each in big 18th games. The geo could conceivably be useful to "spot" gold mines deep in the enemy base and then maybe direct seige cannons on to them with attack ground. It's never been tried yet.
Balancing 21 asymmetric nations is quite a challenge. I might write a post about balancing philosophy some time, I mean for RTS not set piece battles.
Postcript: Believe it or not, I have no idea why my image is a koala. However, I might change it if I knew how.
Message edited by Ftoomsh - Tuesday, 21/May/2013, 2:54 AM |
|
| |
Nowy | Date: Tuesday, 21/May/2013, 3:17 PM | Message # 8 |
Marquis
Group: Users
Messages: 320
Status: Offline
| I wonder why you try mod these strange issues: - walls and fences vision - add more units costs - exclude few gold mines These cases do not improve so much gameplay. There are many more important things. You could mod units statistics, nation balance, formations combats, units skills and behaviours etc.
New units in the game are wellcome, but earlier you should improve units statistics etc. There are many, many stupid cases which can realy spoil gameplay. For instance: - 18c musketeer basic fire power is too weak, it is 12 points while - 18c dragoon basic fire power is too strong, it is 18 points, additionaly dragoon has bigger fire range ! - infantry bayonets are horrible overpowered, even single infantrymen can kill few cavalrymen ! - infantry line formation can so easy stop cavalry charge and infantry can win fighting in melee - cavalry charge impetus is too weak, it can not break attacked infantry thin line formation - cavalry cold arms are too weak, they needs so many thrusts, slashes and cuts to kill enemy - units never weaver, fear, panic and run away, single men can attack on bigger formations - towers and artillery guns are very accurate, they can hit even single men in long range ! - many units and nations are wrongly chosen, badly balanced and looks like clones - AI can organize strange mixed formations, archers and grenadiers - AI send these grenadiers and archers formations to outflank enemy base - AI hold hudge grenadiers formations in strange places while enemy destroy AI's base I could add much more things, but these cases could be enough. There are lot of work for good modders I suppose.
|
|
| |
EbelAngel | Date: Tuesday, 21/May/2013, 4:42 PM | Message # 9 |
Site Administrator
Group: Administrators
Messages: 996
Status: Offline
| Quote (Ftoomsh) The geo could conceivably be useful to "spot" gold mines deep in the enemy base and then maybe direct seige cannons on to them with attack ground. Good point. Didn't think that far.
Quote (Ftoomsh) Postcript: Believe it or not, I have no idea why my image is a koala. However, I might change it if I knew how. Top of site, control bar - General - My profile on the site - edit user details - avatar.
|
|
| |
Ftoomsh | Date: Wednesday, 22/May/2013, 12:42 PM | Message # 10 |
Count
Group: Modders
Messages: 124
Status: Offline
| Nowy, you write "I wonder why you try mod these strange issues." Then you list a number of very good points. However, the points you list relate to Cossacks BTW 1.35. (+ Baddog maybe). Most, or maybe even all, of these points were already corrected by Davout when he created his OC Mod.
I am simply doing a fine tuning re-balancing his OC Mod after testing it in extensive game play. Now, there are many parts to balancing an RTS that has an economic build followed by transfer of economic production into military power. Leaving aside the economic balance and economy to military transfer balance there is the pure military on military balance.
The first part is balancing units to each other eg. infantry vs cavalry. The second part is balancing formation choices so that for example infantry squares are better at repelling cavalry than lines or columns. All of this Davout fixed in OC Mod. The third part is balancing nations.
Now, first we will have to have a theoretical discussion about RTS and nation balance. RTS (Real Time Strategy) is not a battlefield game of two armies lined up for battle, it is a growth game starting with (in the case of OC Mod the way we play it) on lean mines and llean resources with 18 peasants). RTS games like Starcraft, Supreme Commander or Cossacks feature different nations which people can use in multiplayer. The goal is to have all nations balanced for multiplayer play. Some might be better at different aspects and at different phases but all must have realistic chances of defeating any other nation. This is because it is a game and it is not trying for absolute historical accuracy. Realistically, French troops should always defeat Algerian troops in the era unless vastly outnumbered. However, in an RTS game we want both nations to have a fighting chance.
I am really balancing nations and fine tuning the game. The unit balancing was already done for the most part by Davout. Mine is a remod of a mod remember. Unfortunately, at the time Dav released his OC Mod, people had been playing Cossacks I for a long time and many started to move away to other games. Many also did not really appreciate the profound advance Dav had made in the game. For people who liked wild swarming and not careful use of formations it even seemed like less fun. This was because they did not stay on to learn the deeper aspects of the new Mod. If they had, they would have appreciated it created a very profound game.
Because too many people left too soon, OC Mod did not get enough practical play to reveal all the nation balance issues. Clausewitz and I have kept playing it for years. We eventually exposed the imbalanced nations and now I am working on nation balancing and other fine tuning. What you think are strange issues are really fine tuning issues.
Added (22/May/2013, 1:40 AM) --------------------------------------------- EbelAngel, I ought to add we play with Balloon disabled so fog of war is always an issue to deal with. Actually, when you learn to play without geo it's better visually too. You can spot enemy movements on the minimap better without having those permanent yellow dots there to confuse things.
I even considered making the geo upgrade a toggle so you could upgrade and then toggle it on and off (like an upgrade followed by degrade). In that case the toggle cost would be quite small. But I don't know if the engine allows a toggle or degrade like that.
Added (22/May/2013, 12:42 PM) --------------------------------------------- Here is a question which is really baffling me. In what file or files is the data that controls the menus of the officers and troops? I mean the hold ground icon, hold fire icon etc. Indeed, all these icons. I am especially interested in the formations icons. What data controls the appearance or non-appearance of these formations icons?
Also, when a barracks inflates in cost say COSTPERCENT 600 what is the parameter that sets the ceiling? I notice barracks inflate to a ceiling cost and then cost the same after that.
Message edited by Ftoomsh - Wednesday, 22/May/2013, 11:53 PM |
|
| |