Jump to content


Photo

ar0600.ini


  • Please log in to reply
32 replies to this topic

#21 Qwinn

Qwinn
  • Modder
  • 3092 posts

Posted 13 June 2009 - 02:10 PM

AR0502
duplicate section entry: guard5

duplicate section entry: guard5

...
But i would be very surprised if guard5 appears


Believe it or not... yup. He spawns.

You said something about a memory leak. Is that just within DLTCP or something? Or should I fix it to prevent a memory leak in the game even if it's working?

Qwinn

#22 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 14 June 2009 - 02:30 AM

AR0502
duplicate section entry: guard5

duplicate section entry: guard5

...
But i would be very surprised if guard5 appears


Believe it or not... yup. He spawns.

You said something about a memory leak. Is that just within DLTCP or something? Or should I fix it to prevent a memory leak in the game even if it's working?

Qwinn


That was in dltcep's ini loader.
Avenger

#23 scient

scient
  • Modder
  • 1010 posts

Posted 28 June 2009 - 09:32 AM

It does look like there is an issue with "check_view_port" and "check_by_view_port" because while parsing the ini file for zone it does a string compare of these two and fails. However, I haven't tracked down what this actually does to a NPC and couldn't discern any difference even when it worked. Fixing string in engine to match what's in ini files would be simple to do but still like to figure out what it's actually doing.

The engine parses "," and "." the same so no issue there.

I'll have to look into ini stuff more to see how it all works. Might help to track down any other problems.

Edited by scient, 28 June 2009 - 09:32 AM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#24 fuzzie

fuzzie
  • Member
  • 7 posts

Posted 29 June 2009 - 07:05 AM

I'll have to look into ini stuff more to see how it all works. Might help to track down any other problems.


I'd appreciate you mentioning anything surprising you find; gemrb's IniSpawn.cpp contains our spawn ini implementation, but it's not complete (just enough to make PS:T, IWD and IWD2 seem to work, I think).

#25 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 30 June 2009 - 08:50 AM

Well, not just surprising finds :)
If you have any information how the ini spawning should work, i would like to have them.
This means: text descriptions, notes, or annotated disassembly. Whatever you got.
If for nothing else, it would be useful to validate our implementation.
But i believe i missed some parts that would be useful.
(For example: the detail_level tag is completely unknown to me)
Avenger

#26 scient

scient
  • Modder
  • 1010 posts

Posted 30 June 2009 - 09:05 AM

Do you use IDA? I could send you over my IDA db. I'm slowing porting all of my notes which are txt to db like renaming functions/macros/etc. I haven't gotten to looking at area ini files yet. Just finishing up a few fixes that were almost already completed.

There is also "DetailLevel" check inside torment.ini (GetPrivateProfileStringA) where it defaults to "high". There is also another one "BitsPerPixel" which I wasn't sure if it had any real effect. I only noticed them because I added in a patch so folks can now toggle "Strref On" inside ini file. Before, while vanilla ini does have it under program options (like BG1) there was no corresponding code that would toggle it even if you set it to 1. I guess for most folks it's pretty useless. However it is def useful while debugging or if someone has a dialog problem they could turn it on and then reference strref id.

Edited by scient, 30 June 2009 - 09:15 AM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#27 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 30 June 2009 - 10:54 AM

No, but one day i will start using it.
Having a db would just motivate me to start it sooner.

The strrefs are VERY useful for people like us :)
Avenger

#28 scient

scient
  • Modder
  • 1010 posts

Posted 30 June 2009 - 11:33 AM

While this is going into v4 of fixpack, I figured I'd post it now so those debugging or working with PST can use it. Note, offset is the file offset rather than VA.

3. obtain "Strref On" value (0 or 1) when parsing Torment.ini and toggle display of strref id's for all strings in game (defaults to 0 if not set)
offset: 00038B8A
replace 2cd:
83 F8 00 72 05 83 F8 64 76 07 C7 41 20 50 00 00 00 68 84 48 93 00 6A 50 68 F0 35 93 00 68 00 36 93 00 FF 15 B0 C2 8D 00 8B 4D FC 89 41 24 83 F8 00 72 05 83 F8 64 76 07 C7 41 24 50 00 00 00 68 84 48 93 00 6A 50 68 10 36 93 00 68 1C 36 93 00 FF 15 B0 C2 8D 00 8B 4D FC 89 41 1C 83 F8 00 72 05 83 F8 64 76 07 C7 41 1C 50 00 00 00 68 84 48 93 00 6A 00 68 15 8C 43 00 68 1C 36 93 00 FF 15 B0 C2 8D 00 A2 D9 2B 97 00 EB 11 53 74 72 72 65 66 20 4F 6E 00 90 90 90 90 90 90 90
replace 4cd:
83 F8 00 72 05 83 F8 64 76 07 C7 41 20 50 00 00 00 68 88 38 93 00 6A 50 68 F0 25 93 00 68 1C 26 93 00 FF 15 AC B2 8D 00 8B 4D FC 89 41 24 83 F8 00 72 05 83 F8 64 76 07 C7 41 24 50 00 00 00 68 88 38 93 00 6A 50 68 10 26 93 00 68 1C 26 93 00 FF 15 AC B2 8D 00 8B 4D FC 89 41 1C 83 F8 00 72 05 83 F8 64 76 07 C7 41 1C 50 00 00 00 68 88 38 93 00 6A 00 68 15 8C 43 00 68 1C 26 93 00 FF 15 AC B2 8D 00 A2 89 1A 97 00 EB 11 53 74 72 72 65 66 20 4F 6E 00 90 90 90 90 90 90 90


Edited by scient, 30 June 2009 - 11:33 AM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#29 scient

scient
  • Modder
  • 1010 posts

Posted 03 July 2009 - 03:48 PM

Here is a list of all the valid variables/headers you can use in the area ini files. Still working on marking up main parse function for npc variables since it's largest.

TNO/PC headers:
  • locals
  • nameless
  • namelessvar
TNO/PC variables:
  • destare
  • point
  • state
  • partypoint
  • partyarea
general headers:
  • events
  • spawn_main
  • exit
  • enter
spawn variables:
  • interval
  • critters
  • control_var
npc variables:
  • spawn_time_of_day
  • spec_var
  • spec
  • spec_area
  • spec_qty
  • cre_file
  • create_qty
  • script_name
  • ai_ea
  • ai_general
  • ai_race
  • ai_class
  • ai_gender
  • ai_specifics
  • ai_alignment
  • ai_faction
  • ai_team
  • script_override
  • script_class
  • script_race
  • script_general
  • script_default
  • script_area
  • script_specifics
  • dialog
  • good_mod
  • law_mod
  • lady_mod
  • murder_mod
  • death_scriptname
  • death_faction
  • death_team
  • spawn_point
  • point_select
  • point_select_var
  • facing
  • ignore_can_see
  • check_crowd
  • find_safest_point
  • Save_selected_point
  • save_selected_facing
  • spawn_point_global
  • spawn_facing_global
  • inc_spawn_point_index
  • hold_selected_point_key
  • check_by_view_port
  • do_not_spawn
  • auto_buddy
  • detail_level
  • time_of_day

Edited by scient, 03 July 2009 - 03:48 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#30 scient

scient
  • Modder
  • 1010 posts

Posted 04 July 2009 - 02:22 PM

1.
Do you know what 'death_scriptname' is supposed to do?


Well, one thing this enables is KILL_NPC bit in offset 0x2e0 (problem I was talking about in general bug thread). Prob other things, will update if I find anything else.


3. check_view_port vs. check_by_view_port
what is it?
if it is useful, will you fix it by changing the .exe or all the ini files? I would probably alter the exe because it is a smaller change, depends on your choice we implement that version in gemrb (well, once we find out what this flag is supposed to do).


So far I haven't been able to find what this toggles if anything even when I fix the string compare. Going to look into it more.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#31 scient

scient
  • Modder
  • 1010 posts

Posted 07 July 2009 - 01:51 PM

When the ini gets parsed on area load it generates a bitfield with toggles if certain variables are set. So far, here is what I've located. Not all variables are used by it. This is just a brief outline, I'll update it with more info as I go along. The ones I can find nothing for are just "?". Variables listed with "(?)" mean I haven't found code where it's used when spawning NPC's but I do see it setting that bit when parsing ini. Some of the other variables unlisted set up other bytes within parsed ini structure that gets used to spawn NPC. I'll have to double check but it looks like there is only one main parsing function for the "general" set of variables. It looks like there is a separate one for TNO specifics.

ini dword toggle bitfield:
00000000000000000000000000000001 -> 0x00000001 : toggle spec_var
00000000000000000000000000000010 -> 0x00000002 : toggle spec_qty
00000000000000000000000000000100 -> 0x00000004 : toggle spec_area
00000000000000000000000000001000 -> 0x00000008 : toggle spec_area
00000000000000000000000000010000 -> 0x00000010 : toggle create_qty
00000000000000000000000000100000 -> 0x00000020 : toggle ?
00000000000000000000000001000000 -> 0x00000040 : toggle create_qty
00000000000000000000000010000000 -> 0x00000080 : toggle ?
00000000000000000000000100000000 -> 0x00000100 : toggle ?
00000000000000000000001000000000 -> 0x00000200 : toggle ?
00000000000000000000010000000000 -> 0x00000400 : toggle good_mod -> set bit 11 to TRUE at CRE offset 0x2E0
00000000000000000000100000000000 -> 0x00000800 : toggle law_mod -> set bit 12 to TRUE at CRE offset 0x2E0
00000000000000000001000000000000 -> 0x00001000 : toggle lady_mod -> set bit 13 to TRUE at CRE offset 0x2E0
00000000000000000010000000000000 -> 0x00002000 : toggle murder_mod -> set bit 14 to TRUE at CRE offset 0x2E0
00000000000000000100000000000000 -> 0x00004000 : toggle death_scriptname -> set bit 5 to TRUE at CRE offset 0x2E0
00000000000000001000000000000000 -> 0x00008000 : toggle death_faction -> set bit 8 to TRUE at CRE offset 0x2E0
00000000000000010000000000000000 -> 0x00010000 : toggle death_team -> set bit 9 to TRUE at CRE offset 0x2E0
00000000000000100000000000000000 -> 0x00020000 : toggle facing (?)
00000000000001000000000000000000 -> 0x00040000 : toggle ignore_can_see
00000000000010000000000000000000 -> 0x00080000 : toggle check_by_view_port (?)
00000000000100000000000000000000 -> 0x00100000 : toggle check_crowd (?)
00000000001000000000000000000000 -> 0x00200000 : toggle find_safest_point
00000000010000000000000000000000 -> 0x00400000 : toggle inc_spawn_point_index
00000000100000000000000000000000 -> 0x00800000 : toggle hold_selected_point_key
00000001000000000000000000000000 -> 0x01000000 : toggle check do_not_spawn -> skip over loading CRE into memory
00000010000000000000000000000000 -> 0x02000000 : toggle time_of_day
00000100000000000000000000000000 -> 0x04000000 : toggle auto_buddy -> set bit 16 to TRUE at CRE offset 0x2E0
00001000000000000000000000000000 -> 0x08000000 : toggle ?
00010000000000000000000000000000 -> 0x10000000 : toggle ?
00100000000000000000000000000000 -> 0x20000000 : toggle ?
01000000000000000000000000000000 -> 0x40000000 : toggle ?
10000000000000000000000000000000 -> 0x80000000 : toggle ?


Edited by scient, 07 July 2009 - 04:30 PM.

Those interested in the classic TBS game Sid Meier's Alpha Centauri / Alien Crossover should check out the unofficial patch I work on here.


#32 Kung Fu Man

Kung Fu Man
  • Member
  • 48 posts

Posted 30 July 2009 - 08:30 AM

Do you use IDA? I could send you over my IDA db. I'm slowing porting all of my notes which are txt to db like renaming functions/macros/etc.


Forgive the bump, but I too would be interested in this if at all possible.

#33 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 31 July 2009 - 12:37 PM

-> 0x00020000 : toggle facing (?)

I guess this is bit 15 of 0x2e0 (before auto buddy)
Avenger