Multiple hardpoints for heavy body?

Discuss the future of Warzone 2100 with us.
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Multiple hardpoints for heavy body?

Post by lav_coyote25 »

Watermelon wrote: turrent info TurrentRotate


i thought i read some where either on berlios or the RTS forums that the erroneous spelling was corrected.


the proper spelling of the word is    TURRET      TURRETROTATE   

i did a google search of the word turrent and ... well warzone 2100 is not associated with anything of that type...

http://www.cigarworld.pt/index.asp?cat=199
http://www.rottentomatoes.com/p/tomas_perez_turrent/
http://www.altadisusa.com/cigar/aTurrent.asp

and for the word turret i found quite a few... but this explains it very well.
http://aawiki.prixeon.com/index.php?tit ... ns:_Turret

or this one... maybe is time for me to upgrade to the 30... ;D

http://www.gdls.com/systems/lav30-tow.html
‎"to prepare for disaster is to invite it, to not prepare for disaster is a fools choice" -me (kim-lav_coyote25-metcalfe) - it used to be attributed to unknown - but adding the last bit , it now makes sense.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

I believe I have seen the word 'turrent' in few games,but I couldnt recall the names of the games that have this misspelling at the moment.The 'n' is contempting when you spelling the word 'turret' out,dont know why.  :D hope I didnt use the wrong 'turrent' when modifying the source.   ;D

btw just found the definition of 'turrent' via google lol:
http://www.urbandictionary.com/define.php?term=turrent

Finally compile the latest source with MSVC successfully,now it complains about physfs error 'insecure filename' when loading file Image\frend0.png...I did some research in physfs source files,it seems that the error 'insecure filename' should only happen when filepath contains 'illegal' character '.' or '..' ...  ???

Will give older cvs sources a shot with MSVC later.
Last edited by Watermelon on 15 Oct 2006, 21:19, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Multiple hardpoints for heavy body?

Post by DevUrandom »

PhysFS won't load anything with \ in it. Not on Windows, not on Unix. PhysFS only accepts Unix paths.
Do you use the current svn revision? (I saw that your last patch was against a fairly old revision.)
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

yep the one I got 'insecure filename' error was the latest revision 431,I dont think the files I modified have anything to do with physfs or filename/filepath.I tried to compile a 'clean' src with both MSVC and mingw,but it still complained about the 'insecure filename' error when loading resource files.

Here is the patch against rev 431:
Attachments

[The extension has been deactivated and can no longer be displayed.]

tasks postponed until the trunk is relatively stable again.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Multiple hardpoints for heavy body?

Post by DevUrandom »

I think this must be some modification of your local repository... It works fine here on Linux, no PhysFS errors, no not-found files... (unpatched, clean version)
If that were a bug in the SVN repos, it wouldn't work at all here, because I striped all conversion of filenames.
It maybe, perhaps could be a WIN32 only defined block... Then I'd need the exact place in the sourcecode, though.
The name you reported "Images\frend0.png" can't be, because in wrf/frontend.wrf the directory is defined as "images" and not as "Images"...
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

DevUrandom wrote: I think this must be some modification of your local repository... It works fine here on Linux, no PhysFS errors, no not-found files... (unpatched, clean version)
If that were a bug in the SVN repos, it wouldn't work at all here, because I striped all conversion of filenames.
It maybe, perhaps could be a WIN32 only defined block... Then I'd need the exact place in the sourcecode, though.
The name you reported "Images\frend0.png" can't be, because in wrf/frontend.wrf the directory is defined as "images" and not as "Images"...
the file frontend.wrf I used was outdated,so I packed the latest wz files and put them togther with compiled executable,it still complains the same error,except filename is 'images\frend0.png' this time...

assert failure block:
pfile = PHYSFS_openRead(pFileName);
if (!pfile) {
debug(LOG_ERROR, "loadFile2: %s could not be opened: %s", pFileName, PHYSFS_getLastError());
if (hard_fail)
assert(FALSE);
return FALSE;
}


variable values:
pFileName = 'images\frend0.png'
pfile = null
PHYSFS_getLastError() = "insecure filename"


stderr:

error:      loadFile2: images\frend0.png could not be opened: Insecure filename
error:      resLoadFile: Unable to retreive resource - images\frend0.png
error:      resLoad: failed to parse wrf/frontend.wrf
error:      Shutting down after failure
tasks postponed until the trunk is relatively stable again.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Multiple hardpoints for heavy body?

Post by DevUrandom »

Do you have the stack, so we can look where this "\" comes from?
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

DevUrandom wrote: Do you have the stack, so we can look where this "" comes from?
pFileName was passed from aFileName:

aFileName:

strcpy(aFileName, aCurrResDir);
strcat(aFileName, pFile);


pFile was 'frend0.png',so the evil backslash was from aCurrResDir

then in resource_parser.c from dev lex files 7z archive,line 1375,where the aCurrResDir gets appended with a escape-mark'ed '\':


if (strlen((yyvsp[(2) - (2)].sval)) > 0)
{
// Add a trailing '\\'
len = strlen(aCurrResDir);
aCurrResDir[len] = '\\';
aCurrResDir[len+1] = 0;
// DBP0(("aCurrResDir: %s\n", aCurrResDir));
}


Edit:I fixed the 'Insecure filename' by replacing '\\' in the code above with '/',that non-versioned resource_parser.c(from resource_parser.y) file needs to be updated in dev lex files for MSVC  :)
Last edited by Watermelon on 17 Oct 2006, 14:40, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

I encountered an odd problem when debugging my patched rev 431 source with MSVC:

The values of members of Droid->asWeaps[DROID_MAXWEAPS] become a very big unsigned long number (3722304989 in decimal,0xdddddddd in hex),they should be NULL or 0 if a weapon on these slots doesnt exist I think,this weird value just bypasses all checks against Droid->asWeaps[]->members against 0 or NULL and causes a few crashes,could anyone help me out with this problem?  :)

Aside from that weird problem I mentioned above,I did make some progress on adding multiple-turret support:

1.solved few issues with old weapon checks(they were all check against asWeaps[0])
2.added a 'bitfield int' nums_weapon to various functions in ai.c and action.c to check which slot/slots of weapons are available,ready to fire
3.added reference '&' to psDroid->asWeaps[index] in combFire functions used in action.c to cope with weapon array size changes(from asWeaps[0] only to looping through asWeaps[3])
4.added a int 'hydra'(determines whether this droid is multi-turret droid or not) to all droid struct I can find,mayb I'll use Droid->numWeaps and remove it later.


Things I planned to add/fix:

1.fix 3722304989 value crash [done: was a null pointer problem marked by MSVC as freed block ]
2.make drawWeaponReloadBar's x,y,r offsets based on weapon slot number,so the multiple reloadbars wont overlapped each other [done: drawWeaponReloadBar now accepts 3rd parameter 'weapon_slot',a (weapon_slot * 5) offset is applied to pie_FillBox's x0, x1 parameters ]
3.change actionInRange,actionInMinRange etc functions' return value from boolean TRUE or FALSE to 'bitfield int' nums_weapon,thus the droid should be able to know which slot of weapon is InRange/Ready to fire after InRange check,currently these functions are broken in my source:it always returns FALSE because it loops through all weaponslots including the 'empty' ones [done:tested with 1-weapon droid working fine so far ]
4.add multiple copies of TurretPitch,TurretRotate to droid struct,this will break many things...[done: all droid types except structure can have number of 'DROID_MAXWEAPS' copies of TurretPitch and TurretRotate now,modified all related render and game mechanics functions to cope with this change,also made the new droid TurretPitch/TurretRotate array compatible with previous save datas(currently using struct GAME_SAVE_V99)]

5.find solutions for multiple weapon VOTL ai stuff.[bypassed: bypassed with some simple hacks to limit VOTL weapon to 1 ]
6.multi-targeting ai[bypassed: this is optional ]

7.need someone good to tweak design related stuff and fix some validity check functions that are currently broken for multiple weapon droids <- need someone who is very familiar with the render/iIMEshape connectors struct/design GUI to finish this


Please correct me if anything listed above is too stupid,thanks.
Last edited by Watermelon on 20 Oct 2006, 19:48, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Multiple hardpoints for heavy body?

Post by DevUrandom »

If you're working on MSVC, perhaps it's related to this: http://www.docsultant.com/site2/article ... codes.html
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

DevUrandom wrote: If you're working on MSVC, perhaps it's related to this: http://www.docsultant.com/site2/article ... codes.html
Thanks,I'll take a look.

Forgot to ask:
why the game runs poorly in windows mode,e.x:640x480 on a 1024x768 desktop in windows,the game runs like 5 fps when I was debugging the source.(on my old pc:1.4G 512MB ram 64MB video card)
Last edited by Watermelon on 18 Oct 2006, 18:48, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

I have finished all the 'server side' functionalities(hopefully) that are required to implement multiple-turret feature,here is a list of 'client side' things I dont know how to add/fix:

Render:[finished]
Draw multiple-turret on a droid:(display3d.c)

1.actionAlignTurret now calculates all weapons of a droid and stores them in the droid's new TurretRotation/TurretPitch array TurretRotation[DROID_MAXWEAPS],TurretPitch[DROID_MAXWEAPS] respectively.

2.displayComponentObject,displayComponetObj functions now accept an array of mountRotation info and now they loop thru all available weapons of a droid to draw them...


Design Interface:(design.c)
Additional buttons:
1.'Finish' button to finish a design
2.Button for weapon 2
3.Button for weapon 3

Body 'size' check(Light,Medium,Heavy),because I want 1 weapon for light,1-2 weapons for medium,2-3 weapons for heavy.

Weapon/Utility check:any body 'size' should only have 1 utility hardpoint,unlike weapons hardpoints.

Potential problems:

1.heavy body + multiple weapons design's costs might exceed 'price cap'
2.design name might excess 'name length cap' because of the 'hydra' prefix I added to the design name
3.multiple weapons mortar/artillery droid,I am not very familiar with how they work,hope action FIRE_SUPPORT wont cause any problem with multiple mortars droid/hybrid droid.

If anyone can help me with the things listed above,the multi-turret feature should be finished in no time.  :)
Last edited by Watermelon on 22 Oct 2006, 17:14, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
User avatar
Watermelon
Code contributor
Code contributor
Posts: 551
Joined: 08 Oct 2006, 09:37

Re: Multiple hardpoints for heavy body?

Post by Watermelon »

90% of the source changes are done,here is a screenshot of modified interface of the design screen:(added buttons for auxiliary turrets,they show up subsequently after the main turret is set):
Image

There are still build power(price) total system point(HP) calculation problems in some functions,but I think I should be able to fix them.

Another problem is the weaponStats and Droid's asWeaps,I'll need to understand how it works to make multiple weapons added to a droid template struct in proper format/struct,currently it's sorta working,but the 2nd weapon and 3rd weapon are not functioning because of the wrong format/struct of asWeaps[1],asWeaps[2] and component weapon.[solved]

The modifications to 'backend' functions for rendering multiple turrets are done,I couldnt test them because I dont have a pie file with more than 2 CONNECTORS,that's why the multiple turrets are not reflected to the screenshot above.

This is the vehicle used in the test-'Cobra hydra mortar tracks',I enabled the 'hydra status' for this medium vehicle just for tests sake.It is armed with 1 mortar and 2 light cannon,this versatile droid can be used both in close range skirmish and long range artillery.As you can see,it has 3 reload bars instead of 1 when firing its weapons. :)

Image
Last edited by Watermelon on 23 Oct 2006, 14:52, edited 1 time in total.
tasks postponed until the trunk is relatively stable again.
Troman
Trained
Trained
Posts: 424
Joined: 12 Aug 2006, 15:40
Contact:

Re: Multiple hardpoints for heavy body?

Post by Troman »

Watermelon wrote: Forgot to ask:
why the game runs poorly in windows mode,e.x:640x480 on a 1024x768 desktop in windows,the game runs like 5 fps when I was debugging the source.(on my old pc:1.4G 512MB ram 64MB video card)
This is probably because you are using debug build, it is slow on my end too. Release mod runs well even with speed set to 10x on Athlon 2.4 Ghz.
Watermelon wrote: 1.heavy body + multiple weapons design's costs might exceed 'price cap'
Something like a max value for a cost of a droid?
Watermelon wrote: 2.design name might excess 'name length cap' because of the 'hydra' prefix I added to the design name
Do you mean you add "hydra" to all multi-weapon droids? That reminds me: automatic droid naming could also be a small problem, how do we name tanks with multiple weapons? I suppose names would be rather big. Maybe we should only include 'main' weapon name (probably first one).
Watermelon wrote: 3.multiple weapons mortar/artillery droid,I am not very familiar with how they work,hope action FIRE_SUPPORT wont cause any problem with multiple mortars droid/hybrid droid.
Not sure how FIRE_SUPPORT works. In the worst case scenario we will figure out by trial and error. ;)

And i'm sure more problems will arise, but that's another side of adding new features.
Watermelon wrote: This is the vehicle used in the test-'Cobra hydra mortar tracks',I enabled the 'hydra status' for this medium vehicle just for tests sake.It is armed with 1 mortar and 2 light cannon,this versatile droid can be used both in close range skirmish and long range artillery.As you can see,it has 3 reload bars instead of 1 when firing its weapons.
That tank is equipped with 3 weapons? It is a bit hard to differenciate anything, I wish the screenshot was of a higher resolution.

It will also be necessary to modify the syntax of assignWeapons.txt. We can probably agree on the highest number of weapons a droid can have (3, 4?) and depending on that number add trailing 0's.

Well done.
Sign Up for Beta-Testing:
?topic=1617.0
Troman
Trained
Trained
Posts: 424
Joined: 12 Aug 2006, 15:40
Contact:

Re: Multiple hardpoints for heavy body?

Post by Troman »

BTW if needed, we can organize a small meeting on IRC, 10 minutes can be worth of days of forum postings.

We sometimes hang out on freenode servers, in #warzone.
Sign Up for Beta-Testing:
?topic=1617.0
Post Reply