Home » MODDING HQ 1.13 » v1.13 General Development Talk » 100AP Project - open Beta
Re: 100AP Project - open Beta[message #203122] Wed, 03 December 2008 00:26 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
ChrisL
Starwalker
Ahhh, I was under the assumption that the uncommented values would always be taken, being equal to the defaults or not...
I wanted to do that but I wasn't sure how to make the program realize that a value hadn't been entered. Then Rowa21 wrote the INI Editor and explained that, for it to work right, the values needed to be uncommented. Smile


I had to remove the comments from the INI file, so that the property values are shown in the INI Editor. If you select the INI file in the drop down list, a button next appears, where you can reset all the values in the INI file to the default values.

@Chris: The default values are taken from the original APBPConstants.ini (from the SVN GameDir) and stored in the "INIEditorAPBPConstants.xml". These are the correct default values, I assume. Is that correct? So the only to change from 100 AP to 25 AP is to set AP_MAXIMUM = 25 and for the other values take the default property values.

Report message to a moderator

Sergeant Major

Re: 100AP Project - open Beta[message #203124] Wed, 03 December 2008 00:43 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
That should work just fine, Rowa21. As far as the code is concerned, if (for example) AP_MINIMUM reads in as 40, then it'll be dynamically adjusted based on the AP_MAXIMUM value.

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203131] Wed, 03 December 2008 02:14 Go to previous messageGo to next message
Scheinworld is currently offline Scheinworld

 
Messages:961
Registered:December 2007
Location: Baltic Sea, Germany
Hello again,

RoWa21

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203154] Wed, 03 December 2008 11:14 Go to previous messageGo to next message
cougar

 
Messages:254
Registered:March 2000
Scheinworld
Do you have an idea what

Report message to a moderator

Master Sergeant
Re: 100AP Project - open Beta[message #203176] Wed, 03 December 2008 16:56 Go to previous messageGo to next message
Scheinworld is currently offline Scheinworld

 
Messages:961
Registered:December 2007
Location: Baltic Sea, Germany
cougar
Ivan is running, Magic is walking.


My God! Now I feel sheepish about it. :roulette: Thank you cougar for the hint, I

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203191] Wed, 03 December 2008 17:53 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
You can also get them in run mode by clicking on the right button or doubling clicking when you order them to move.

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203222] Wed, 03 December 2008 22:42 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
Tais
just played with 100 extra and it worked perfectly


i just found out the player_ap_bonus cant go any higher than 120 (probably 127)... could it be that player_ap_bonus is also an int8 or something like that?, just tried 150 and again my mercs stopped walking in real time mode, then when it turned to turn based mode they had like -44 ap.
when i set it to 200 real time mode worked perfect but when in turn based mode they only had 44ap

maybe this is also fixable?

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203239] Thu, 04 December 2008 00:56 Go to previous messageGo to next message
Scheinworld is currently offline Scheinworld

 
Messages:961
Registered:December 2007
Location: Baltic Sea, Germany
SpaceViking
You can also get them in run mode by clicking on the right button or doubling clicking when you order them to move.


Yes, that was the reason for my "false alarm", sorry. I think that I should more play the game than tinkering of any files or mixing of different files in the near future, but it simply makes me fun. Smile


Best regards; Schein

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203248] Thu, 04 December 2008 04:31 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
Tais
i just found out the player_ap_bonus cant go any higher than 120 (probably 127)...

maybe this is also fixable?


This has already been fixed.

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203307] Thu, 04 December 2008 18:32 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
when because i compiled the version including chrisL's fix for the int8 conversion, this is the version i got the problem with so there has to be something wrong with the player_ap_bonus, before chrisL's fix the total ap couldn't go above 127

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203310] Thu, 04 December 2008 18:48 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Tais, it's not a bug. The player_ap_bonus (as well as the other ap_bonus values) at signed, 8bit values. Meaning they can take a value of -128 - 127. These ab_bonus values aren't meant to be used with such large numbers, hence why they were created as INT8 variables. So this isn't a bug. It's simply you, the user, using a value that is out of range. Yes, we could probably change this variable to an INT16 or something, but that wouldn't change the fact that you're using a value that's larger then what the variable was intended for.
If you tried to set MAX_IMP_CHARACTERS to 7, you'll encounter problems in the code. We don't see that as a bug, though, as that value shouldn't be anything but 1-6. About the only thing that could be considered a bug is that the code isn't built with any checking to make sure that a value set in the INI file is set within a valid range. That's probably something we need to correct, but as there are hundreds of INI settings, that's alot of error checking that would need to be added. Meaning it would take someone alot of time. Time that most of the coders are already using on other things. I'm sure someone will eventually get around to this, though.

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203314] Thu, 04 December 2008 19:04 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
You can set MAX_IMP_CHARACTERS to more than 6 but you also have to set the other values around there to point to whatever slots you have set up for a 7th or more IMP. The problem is there is only voice work for 6 (3 males, 3 females).

I've played some using otherwise unused slots (there's a list in the .ini) as IMPs without the voice files and it works, sort of. The IMPs are mostly quiet and sometimes their protraits pop up as if they are going to say something but then don't. I never played too far into the game so there may be things that break later on.

For the "too large" value read in from the INI we should probably change where the values for AP bonuses are read to exclude values that are too large. There is a version of CIniReader::ReadInteger that takes a minimum and maximum value. That could be used and set the minimum to 0 and the maximum to 127. Maybe like this:

// Enemy AP settings
gGameExternalOptions.iEasyAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","NOVICE_AP_BONUS",0,0,127-baseAPs);
gGameExternalOptions.iExperiencedAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","EXPERIENCED_AP_BONUS",0,0,127-baseAPs);
gGameExternalOptions.iExpertAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","EXPERT_AP_BONUS",0,0,127-baseAPs);
gGameExternalOptions.iInsaneAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","INSANE_AP_BONUS",0,0,127-baseAPs);
gGameExternalOptions.iPlayerAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","PLAYER_AP_BONUS",0,0,127-baseAPs);

where baseAPs is whatever the base APs are (100 or 25 or whatever)

[Updated on: Thu, 04 December 2008 19:05] by Moderator

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203317] Thu, 04 December 2008 19:14 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
I wouldn't use "127-baseAPs" because baseAPs could be set to 32000 if you wanted. I'm pretty sure it won't display properly, but you could set them. And I wouldn't set the minimum value to 0. I'm assuming that the reason this was created with a signed interger was so you could create an ap penalty by coding a negative value. That being said, coding maximum and minimum values that fit what the interger can hold isn't a bad idea. I'll play around with that.

EDIT: I've made the following changes based on SpaceVikings suggestions:
// Enemy AP settings
gGameExternalOptions.iEasyAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","NOVICE_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iExperiencedAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","EXPERIENCED_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iExpertAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","EXPERT_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iInsaneAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","INSANE_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
gGameExternalOptions.iPlayerAPBonus = (INT8) iniReader.ReadInteger("JA2 Tactical Settings","PLAYER_AP_BONUS",0,__max(-APBPConstants[AP_MINIMUM],-128),127);
The max bonus is 127 instead of being based on AP_MAXIMUM. The minimum "bonus" is a bit trickier. You can't have negative possible APs. If you do, you can't move while in strategic. So if AP_MAXIMUM = 100 but you set a PLAYER_AP_BONUS = -128, you wouldn't be able to move. So, as you can see from the code above, I'm using the maximum of -APBPConstants[AP_MINIMUM] (so -40 by default) or -128. So if you put in a huge negative value, the code will use either -128 or the reverse of whatever you set for AP_MINIMUM. This still won't stop players from putting in values that won't work, but it should make it harder to mess things up.

[Updated on: Thu, 04 December 2008 19:33] by Moderator

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203323] Thu, 04 December 2008 19:57 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
okay i get the fact it's meant as an int8...
but i've been playing the 25ap version with 50 extra ap (don't ask why..), with the 100ap i would had liked to get 200ap extra, but i guess that's just gonna be limited to about 120 extra..

can't blame me for checking if it was possible and asking Razz

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203355] Fri, 05 December 2008 00:05 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Actually, 127 would be your maximum. You can put in more then that but the new code will reset it to 127 if you do.

And nothing wrong with asking. It just takes alot of work to change the size of variables. You'd be surprised how much you have to change by changing the size of just a single variable. *chuckle*

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203395] Fri, 05 December 2008 10:54 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
i guess i'll go have a run around the code and try to change it myself, after that i'll propose the changes in code to you guys, hmmm where to start.... Razz

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203473] Sat, 06 December 2008 18:23 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
i found a nice one again...

set bonus ap to 127 so you get 227 ap total, play the game and empty your magazine in full auto so for example 20 rounds full auto, it will cost you -92 ap..

the fact that it's limited by 127ap makes bonus ap's in 100ap mode almost impossible, you're maxed to 27 ap bonus as a max, everything higher gives a chance to get negative ap's for an action

int8's are evil Mad

19 bullets http://img528.imageshack.us/my.php?image=aiming1na4.jpg

20 bullets http://img92.imageshack.us/my.php?image=aiming2kk6.jpg

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203750] Wed, 10 December 2008 21:12 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Yeah. I hate all the places that APs can be refered to as 8bit values. I found the one that was causeing this and I've got it fixed. I also found another issue related to autofire when using an xxx_AP_BONUS ini setting, and I've got it fixed as well. I'll upload these fixes in a little while but you'll have to wait for a new build which I wouldn't expect for a little while. Smile

Keep doing these experiments, Tais.

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203773] Thu, 11 December 2008 01:33 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
If you think THAT is bad you should see what happened when I tried to switch to allow more than 255 characters. It was like a virus that spread through almost every bit of code in JA2.

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203798] Thu, 11 December 2008 11:29 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
i'll just try a new debug build from the source and keep playing with high bonus values
isnt it just possbile to do a mass replace action of all int8 value declarations to int16's? Razz
wait i'll let my notepad++ do that and see if my pc blows smoke when i try to run it...

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203847] Thu, 11 December 2008 18:54 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
The problem with doing that (int8->int16) is that all the save files, maps, and other stored binary files will no longer work.

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203866] Fri, 12 December 2008 00:19 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Though we did try to do mass find/replace when we converted the AP values to INT16s. But we obviously missed some. And in this case, it was a recast. There was a return statement that we recasting the variable as an INT8 [return (INT8}apCost].

EDIT: BTW, I'm working on something with Gotthard that might (if we can get it to work) make it possible to make changes to the saved structures without screwing up save game compatability. Still wouldn't be feasible to simply find/replace every INT8/UINT8 with INT16/UINT16, but at least it would resolve the save game issue.

[Updated on: Fri, 12 December 2008 00:21] by Moderator

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203871] Fri, 12 December 2008 03:53 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
Is that the thing you were asking me about before with alignments and data sizes and such? That will be great!

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #203930] Fri, 12 December 2008 18:31 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Actually, I used the discussion I had with you regarding alignments and data sizes to write the ReadFieldByField() function. Now I'm working on a way to use that function (or something similar) to individually read each member in a structure without having to manually write 1500 lines (one for each member of the SOLDIERTYPE structure). My theory is that if we can load a save game by reading individual structure/class members, instead of being forced to read the entire structure/class block at once, then if you changed the size of a member in a structure/class you could simply modify the way that one member was being read. Thus protecting savegame compatability. I just don't want to have to have 1500 (think there's about that many members in the complete SOLDIERTYPE class) lines that are basically identically to one another. Smile

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #203956] Sat, 13 December 2008 09:30 Go to previous messageGo to next message
Burnov is currently offline Burnov

 
Messages:9
Registered:November 2007
When a stable release is achieved, this needs to be incorporated with H.A.M

Report message to a moderator

Private
Re: 100AP Project - open Beta[message #203966] Sat, 13 December 2008 15:22 Go to previous messageGo to next message
Marlboro Man

 
Messages:1159
Registered:October 2005
Location: USA
Burnov
When a stable release is achieved, this needs to be incorporated with H.A.M



:biglaugh:


It's already stable. :party:

Report message to a moderator

Sergeant Major

Re: 100AP Project - open Beta[message #204131] Mon, 15 December 2008 18:40 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Marlboro Man
Burnov
When a stable release is achieved, this needs to be incorporated with H.A.M

:biglaugh:
It's already stable. :party:

And HAM is a side project. It's up to Headrock to incorporate the latest changes to the main code branch (which includes 100AP) into his HAM project when (and if) he feels the desire to do so. Smile

Report message to a moderator

First Sergeant
Re: 100AP Project - open Beta[message #243304] Fri, 05 February 2010 10:15 Go to previous messageGo to next message
hairfoot is currently offline hairfoot

 
Messages:15
Registered:December 2009
Pardon the necromancy, but since swapping between 100AP/25AP is being discussed here, I'll bump this thread instead of starting a new one.

I've gone into the APBPconstants through the INI editor, but it already lists the AP_Maximum value as 25, even though the game is using 100APs when I load it up. Is there something else I should adjust to make it 25APs?

Report message to a moderator

Private
Re: 100AP Project - open Beta[message #243322] Fri, 05 February 2010 14:46 Go to previous messageGo to next message
Starwalker is currently offline Starwalker

 
Messages:759
Registered:October 2005
Location: Hannover, Germany
Perhaps you opened/changed the wrong APBPConstants.ini?
There's one in the Data-folder and another in the Data-1.13-folder.

[Updated on: Fri, 05 February 2010 14:46] by Moderator

Report message to a moderator

First Sergeant

Re: 100AP Project - open Beta[message #243374] Sat, 06 February 2010 02:55 Go to previous message
hairfoot is currently offline hairfoot

 
Messages:15
Registered:December 2009
Fixed it. I had to edit it in notepad instead of the INI editor. Don't know if that's a bug.

Report message to a moderator

Private
Previous Topic: Looking for mod project managers in 2010
Next Topic: HAM 3.6 Alpha - RELEASED
Goto Forum:
  


Current Time: Sat Apr 20 08:39:44 GMT+3 2024

Total time taken to generate the page: 0.01903 seconds