Jump to content


Blades of Geneforge - How it could be done

Blades of Geneforge Geneforge Nethergate Blades of Nethergate

  • Please log in to reply
94 replies to this topic
Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 05 September 2013 - 07:42 PM #36 Blades of Geneforge - How it could be done

I opened the file in the Edit command of the Command Prompt. To access this, just type Edit at the Prompt, then hit Enter.

Offset 106 has a value of 82, which is the number of towns.
Offset 108 has a value of 25, which is what? I don't know.
There is a 20*100 set of records starting at offset 112. Looking at the outdoor town icons leads me to believe the array starts at 112 and not 110. Each record includes where the town appears on the outdoor map and what icon it has there. It also includes which towns are available from each of the four exit directions.

At offset 2,560 the town records occur: 82 * 52,088 = 4,271,216.
2,560 + 4,271,216 = 4,273,776 = the size of the file.
It seems all town records have the same size of 52,088 Bytes. Hence all are 64x64 in size!
Here are the latest guesses:
Within each town record you seem to have 64x64 = 4,096 Bytes of floor map. Then the same for terrain, which seems to one Byte not two as in BoA.
Then 4,096 Bytes of lighting?
Then you have the objects, a sub-set of what would be terrain in BoA. Objects may be listed by coordinate not mapped.

Edited by Ishad Nha, 29 September 2013 - 02:41 AM.


Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 06 September 2013 - 05:08 PM #37 Blades of Geneforge - How it could be done

Useful tools:
(1) Spreadsheets often have a Hex2Dec function which turns all hex numbers into decimal. Decryption is far quicker then.
(2) Most hex editors allow you to choose the width of the hex display, this makes patterns very easy to spot.

Now I am going to make a list of all item, creature, terrain type and object names.
I am now working on town 1 in GF4, Southforge Citadel. (When played on my old PC GF5 maxes out my CPU usage, which you can hear all the time. Also I am much more familiar with GF4.) GF4 seems to have the same structure as GF5.

Using a spreadsheet, a hex editor and the BoA Editor I was able to quickly whip up lists for all five object types: Floor, Terrain, Object, Creature and Item.
I have been able to port the Zone (Town) 1 walls into a BoA scenario. This tells me what the coordinates of a given point are, this is very useful to decryption. Not all GF wall types can be ported to BoA but the Editor icons can make up for that. Editor icons can represent the reality of GF4 not BoA. I am not trying to port GF4 to the BoA world, I am trying to map the floor plan of zone 1.
I will need to learn how graphics templates work in GF4.
As GF4 has only 256 terrain types, I can use terrain slots 256 thru 511 to represent the GF4 objects.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 10 September 2013 - 01:42 AM #38 Blades of Geneforge - How it could be done

Data name Start Length
Town name 0 20
Script name 20 12
Floor[64][64] 32 4,096
Terrain[64][64] 4,128 4,096
Lighting[64][64] 8,224 4,096
Items[220][16] 12,320 3,520
Objects[256][56] 15,840 14,336
Creatures[108][80] 30,176 8,640
Town Entrances[4] 38,816 32
Special Rectangles[60][8] 38,848 480
Specials Called [60][2] 39,328 120
Town Exits[4] 39,448 32
Town Boundary 39,480 8
Mini paths [12][196] 39,488 2,352
The [250][28] path points 41,840 7,000
Navigation Points[8][8] 48,840 64
Floor/Wall Details 48,904 24
Unused Locations [10][8] 48,928 80
Unused 49,008 2,560
Automap Note Locations[10][8] 51,568 80
Automap Notes[10][40] 51,648 400
Unused2 52,048 40

52,088     EOF: End of File

Floor[64][64], Terrain[64][64], Lighting[64][64]: values are stored in a 64x64 map.
Otherwise, [A][[B] means there are A records, each of which is B Bytes in length.
Town Entrances are squares where the PC ends up when he enters a town from the given direction: N,W,S,E.
Town Exits are those shaded areas that you click on when you want to leave town in the given direction.

If the special id of a special rect is < 100, the dialogue node is called; if > 100 a special node is called.

Unused locations are unused in all zones, I don't know what they are, legacy from earlier Geneforge games?

Edited by Ishad Nha, 07 January 2014 - 02:05 AM.


Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 10 September 2013 - 02:19 AM #39 Blades of Geneforge - How it could be done

I was working on the first Geneforge, as it had the shortest download. Its structure is : floors first, terrain second, items third, objects fourth and creatures fifth. There are a last few sections (around 6K bytes) that I couldn't understand, but they must specify the floor tiles which, when stepped upon, bring up a talknode or state which prints text on the play area and the zone-tiles which take you to the outdoor map too (as they don't seem to be contained anywhere else).

Zones are 64x64, the floors and terrain are mapped (each tile must compulsorily contain one floor and one tile) but the items, objects and creatures are listed by positions. Each zone is 38796 in length because of which even non-existent entities must be represented by a series of hexadecimal F's.

There's a problem with town script names. I changed "docks" to "d*cks" in the scenario but the game refused to start up even though I'd renamed the corresponding file in the scripts folder.

Doubts
-------------
  • Does anyone remember which that area is, where what is apparently a row of trees suddenly gives way to a clearing with a supply cache and canister ?
  • Memory cells, x, y, friendly-state etc are okay, but where is the level of each creature stored ?
  • Object scripts are properly represented in hex, but creature scripts seem to have their first letter cut off (ornks have the value "locknpc" which I suppose means "flocknpc")
  • You said G5 has 52088 bytes, so 13292 bytes are extra for G5, what do G5 scenarios have that G1 doesn't ? (I believe there is no lighting for G1)

View PostIshad Nha, on 06 September 2013 - 05:08 PM, said:

(1) Spreadsheets often have a Hex2Dec function which turns all hex numbers into decimal. Decryption is far quicker then.

That's neat, I'll check that out.
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 10 September 2013 - 07:30 AM #40 Blades of Geneforge - How it could be done

"Memory cells, x, y, friendly-state etc are okay, but where is the level of each creature stored ?"
It may be fixed for each creature type, decreed in the scenario data script.

"Object scripts are properly represented in hex, but creature scripts seem to have their first letter cut off (ornks have the value "locknpc" which I suppose means "flocknpc")"
There is no such script as "locknpc", so it is presumably a deleted "flocknpc" script.

"You said G5 has 52088 bytes, so 13292 bytes are extra for G5, what do G5 scenarios have that G1 doesn't ? (I believe there is no lighting for G1)"
Lighting for starters, if that is what it is. I still am not finished with G4, I am having trouble figuring out what is going on. Placed specials seem to work differently, town scripts are much simpler.

"(1) Spreadsheets often have a Hex2Dec function which turns all hex numbers into decimal. Decryption is far quicker then."
Microsoft Works spreadsheet has no such function. But Excel does, ditto the Open Office Calc program.

Edit:
I am having trouble understanding the placed specials, how they are called. (How numbers in the dat file call a special.) It seems very different to BoA.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 11 September 2013 - 05:33 AM #41 Blades of Geneforge - How it could be done

As far as I can tell, the possible floor types available in a town vary from town to town. I altered the floor maps of towns 0 and 2, every floor type was shown in a grid. The two towns had different varieties of possible floors.

Creating lists of creatures, items, objects, whatever for G5 or any other Spiderweb game of the last decade:

Aim here is only to create lists. One idea, make backups of the core BoA data scripts and use them. Then use the BoA Editor to churn out the names. I will use a list of Creatures as an example. This avoids contamination of data when the GF5, or whatever, script leaves slots unused.

Firstly I want to get rid of everything in the list except for begindefinecreature, import, clear and cr_name. Simply use Replace All to replace any "cr_" with "// cr_", this comments out any thing that might not be a valid call in BoA. It throws out everything, what we want along with what we don't. Next use Replace All to change "// cr_name" with "cr_name". This restores the "cr_name" to the list of valid functions.
This approach also works for item, floor and terrain types. For objects, change the "ob_" to "te_".

Edited by Ishad Nha, 21 November 2013 - 05:21 AM.


Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 12 September 2013 - 01:41 AM #42 Blades of Geneforge - How it could be done

Jeff sent me an email which I understand to mean that he can't get involved for licensing reasons but our project has his blessing. (We really need his notes!)

Making some sense of the specials now that I understand where they are found.
Text of signs is stored in the town script:
Sign text is a special state = 100 + Townscript state

States 1,3,4,9,193: check the begintalknode # in the town dialog script.

Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 13 September 2013 - 07:00 AM #43 Blades of Geneforge - How it could be done

It's great to hear that Jeff is totally okay with this :)

Posted Image

Posted Image

Posted Image


I'd mapped the scenario coordinates onto a console, and this is what it looks like. The first pic shows a +5 Unlock canister placed at the game beginning, the second shows a symbolic map of the first scenario with all the unknown points marked in "?" and the third shows all floor values in decimal. I'll upload a program to automate some scripting steps and to help map coordinates.

The points marked by "?" in the second pic are frustrating. Ishad Nha, are these what you called "special rectangles/called" in your previous post ? Some of them do form neat rectangles, but I couldn't figure out how they're triggered and I just have a vague impression that going somewhere near these points brings up a talknode.
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 13 September 2013 - 07:30 AM #44 Blades of Geneforge - How it could be done

I have designed a spreadsheet that allows conversion of features of a Geneforge town to a format suitable for display by a BoA Editor. This shows the exact coordinates of a given square. It only covers a 2D display not a 3D one but it is still useful for decryption.

"The points marked by "?" in the second pic are frustrating. Ishad Nha, are these what you called "special rectangles/called" in your previous post ?"
Currently I am doing G4/G5 not G1. I will need to break off and have a look at your problem, this may take a while...
I will need to decrypt G1, it is different to G4/G5.

Vox Vox

Citizen

  • Member
    • Member ID: 10,098
  • 45 posts

Posted 13 September 2013 - 08:36 AM #45 Blades of Geneforge - How it could be done

you guys are doing an incredible job, keep it up!

Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 13 September 2013 - 09:40 AM #46 Blades of Geneforge - How it could be done

I've no BoA scripting experience and know nothing about the editor, so I'm afraid I can't help in any way in porting it to Geneforge. What I can do, however, is to create a command-based tool which can be used for testing or for inserting/removing immediate entities (items/objects) into a scenario in a more simplified way.

Here is the program as it stands. It is not created/supported by Spiderweb Software, the creators of Geneforge and the same has been mentioned in the readme. Don't forget to create a backup of the GFScenData.dat file contained in your game's 'data' folder before using it.

http://www.directlin...ousDrayk.rar(For Geneforge 1, Windows)
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 13 September 2013 - 06:53 PM #47 Blades of Geneforge - How it could be done

I am not porting GF# to BoA in the way that you port BoE to BoA. The "scenarios" are not playable and are not meant to be. I am just using the 3D Editor the way you use your console.

I have GF1 town 0 data converted to decimal format. Now I can look through it and see what its structure is.
Edit:
I figured out the scenario lists of names for floor types, terrain types, objects, creatures and items.
Now I will check my lists of Zone 0 items and objects, see if they are accurate.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 14 September 2013 - 04:51 AM #48 Blades of Geneforge - How it could be done

This is my understanding of the Geneforge 1 Zone data record:
Data Type, Start, Length
Town name 0 20
Script name 20 12
Floor[64][64] 32 4,096
Terrain[64][64] 4,128 4,096
Items[120][16] 8,224 1,920
Objects[256][56] 10,144 14,336
Creatures[108][76] 24,480 8,208
Town Entrances[4] 32,688 32
Specials[60][8] 32,720 480
Specials[60][2] 33,200 120
Town Exits[4] 33,320 32
?Town Boundary 33,352 8
?? 33,360 1,968
??[120][28] 35,328 3,360
?? 38,688 108
38,796 EOF

Generally the format is the same for G4/G5.

??[120][28] 35,328 3,360
has a format like:
0 1 0 0 0 0 0 10 0 0 0 55
0 1 0 0 0 0 0 14 0 0 0 55
0 1 0 0 0 0 0 10 0 0 0 50
0 1 0 0 0 0 0 14 0 0 0 50
0 1 0 0 0 0 0 18 0 0 0 52
0 1 0 0 0 0 0 21 0 0 0 55
0 1 0 0 0 0 0 25 0 0 0 56

Edited by Ishad Nha, 14 September 2013 - 04:55 AM.


Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 14 September 2013 - 06:16 AM #49 Blades of Geneforge - How it could be done

That's fantastic work. Hm so the town entrances and specials come after the creatures; I'll play around a bit with the bytes.

View PostIshad Nha, on 13 September 2013 - 06:53 PM, said:

I am not porting GF# to BoA in the way that you port BoE to BoA.

Isn't modifying the BoA Editor source to make it able to create G# scenarios what we are doing ?
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 14 September 2013 - 07:04 AM #50 Blades of Geneforge - How it could be done

"Isn't modifying the BoA Editor source to make it able to create G# scenarios what we are doing ?"
Yes, after we have decrypted the Scendata.dat files. "Port" means to make a fully functional translation of something, which is not my goal here. I am not trying to make GF# into a fully playable BoA scenario which you can play with the BoA game.
Here I am using the BoA Editor to enable understanding of GF# so we can make a GF5 Editor.

As for the
0 1 0 0 0 0 0 10 0 0 0 55
0 1 0 0 0 0 0 14 0 0 0 55
0 1 0 0 0 0 0 10 0 0 0 50
0 1 0 0 0 0 0 14 0 0 0 50
we could place terrain scripts on those squares and see if any patterns become obvious.

I have created a Microsoft Works spreadsheet that enables porting of features of a GF1 town into a BoA town. Thus you can see the placed specials.

Here is the list of placed specials from town 0:
Y X Y X
0 48 0 8 0 52 0 14
0 53 0 9 0 53 0 11
0 53 0 32 0 58 0 32
0 44 0 32 0 45 0 34
0 43 0 28 0 45 0 29
0 55 0 24 0 57 0 25
0 42 0 26 0 42 0 28
0 56 0 37 0 58 0 37
0 33 0 42 0 36 0 45
0 29 0 46 0 31 0 46
0 36 0 13 0 36 0 15
0 27 0 13 0 27 0 15
0 47 0 26 0 49 0 28
0 25 0 10 0 25 0 22
0 24 0 55 0 26 0 58
0 28 0 56 0 30 0 58
0 8 0 16 0 9 0 38
0 22 0 39 0 26 0 40
0 55 0 41 0 58 0 41
0 53 0 43 0 53 0 43
0 54 0 43 0 54 0 44
0 53 0 18 0 53 0 20

Here is the list of specials actually called by the above rectangles:
0 110
0 1
0 2
0 111
0 112
0 113
0 4
0 114
0 115
0 7
0 8
0 8
0 3
0 9
0 116
0 117
0 118
0 119
0 121
0 120
0 6
0 122

Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 14 September 2013 - 07:10 PM #51 Blades of Geneforge - How it could be done

I find the 'specials' concept to be somewhat alien; I'll have to read up a bit on BoA scripting.
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 14 September 2013 - 07:56 PM #52 Blades of Geneforge - How it could be done

Placed specials are not hard to understand, you step on a square and something from your townscript happens. In Geneforge games, unlike BoA, a placed special can also call a state from a town dialog script.
Sign text is a special state = 100 + Townscript state
States 1,3,4,9: check the begintalknode # in the town dialog script.

Edit:
Now I am starting on altering the source code for the BoA 3D Scenario Editor.
I will equate GF5 zones to BoA towns, hence all traces of the BoA outdoor zones will be removed from the code. The 100x20 outdoor map data structure will be placed in the Scenario menu. Horses, Boats, variable towns will all need to be removed too.
This alteration will easily take days or weeks.

A GF1 zone record has 38,796 = 12*53*61 Bytes. Thus if you display it in a hex editor with line width set to 53 or 61, the towns will always start in the same column.
GF2: 3,529,440 = 41,040 * 86 = 5*16*27*19
GF3: 4,421,144 = 48,584 * 91 = 8*6,073. 6,073 is a prime number, no use to us here.
For GF4 and GF5, 52,088 = 8*17*383 =68*766

Edited by Ishad Nha, 16 September 2013 - 10:35 PM.


Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 17 September 2013 - 07:33 AM #53 Blades of Geneforge - How it could be done

I can write a program that turns a hexadecimal town record into a decimal printout. Also, the printout has the correct number of bytes for each line. If the creature records each have 80 bytes then the printout can have one record per line. It should be useful in decrypting the records.
The program can be re-written to make it applicable to any Spiderweb game.

Little Fyora Little Fyora

Soldier

  • Member
    • Member ID: 9,192
  • 103 posts

Posted 20 September 2013 - 04:35 AM #54 Blades of Geneforge - How it could be done

I read all the records byte-by-byte and discarded the unwanted bytes in the sequence, only because I couldn't come up with a structure which exactly matches the one used by Jeff. Even with byte-padding put in, I don't see the need for so many empty spaces between the the values in the file.

From a programming interest, I'm interested to know what methods will you be using (since I didn't use structures I just used the raw read() and write() methods for individual bytes) ?
Everything is changeable, anything can be done. The universe exists to be understood.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 20 September 2013 - 08:29 AM #55 Blades of Geneforge - How it could be done

Jeff does use 2 Bytes for a value when 1 Byte would do.
As for empty space, we would need to read all of the town records before we could be sure that empty space was never used.

"From a programming interest, I'm interested to know what methods will you be using"
Do you mean with the G5 printout program? I have not gotten around to read/write, I am not much of a programmer. I will be using fopen if and when I get around to writing a proper program. Said program is only a means to decryption, not an end in itself. I have a 52,088 Byte table compiled into the program. When I want to printout a new town I just copy and paste a town record from the G5Scendata.dat file right into the program.

I am making some progress with the creature records, in BoA the first number for town creatures is 6 in G5 it is 8.

The creature data structure seems to be like this:
1-2: Creature type number
5: Adjustment to X coordinate of position
6: X coordinate of position
7-8: Empty
9: Adjustment to Y coordinate of position
10: Y coordinate of position
11-12: Empty
13-24: Creature script
25-44: Memory Cells[10]?
45-52: looks like items carried and chances of them being carried
53-54: nothing?
55-56: attitude

65-66: facing
Here I am numbering from 1 to 80.

Where are the navpoints? Alter the scripts to send the creatures marching towards navpoints.

Edited by Ishad Nha, 20 September 2013 - 07:01 PM.


Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 21 September 2013 - 04:13 PM #56 Blades of Geneforge - How it could be done

Jeff does use 2 Bytes for a value when 1 Byte would do.
Jeff does use 4 Bytes for a value when 1 Byte would do.

I found the navigation points at offset 48,840:
In town 1, Minallah, a servile called Gevik had the "mobleadpc" script, which involves the use of way points, navigation points. He seemed to stop at a square x = 5, y = 20. I found a possibility in the town record at offset 48,840. It was prudent to check that this was really the waypoint. Hence I altered it to read x = 49, y = 8. Now Gevik leads the PC to the town 0 entrance in the NE corner of town.


????[250][28] 41,840 7,000. This may be a set of paths followed by creatures with certain creature scripts, I will need to research this further.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 26 September 2013 - 04:50 AM #57 Blades of Geneforge - How it could be done

I feared that if Jeff did not hand over the source code to the Editor this whole process would be slow. It sure has been.
Can't identify the places where the following are recorded:
spawn point, floor types, wall types, town lighting levels.
Offsets 48.920:48.927, this is the one area where something might be stored.

I created a zone printout program for G4, this may yield some answers.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 26 September 2013 - 08:48 PM #58 Blades of Geneforge - How it could be done

Floor types, wall types, town lighting levels may all be hard-coded for all I know.
It may be possible to track down and decrypt the tables concerned, it seems they are found in the program.

(Mercifully, Tridash found the place where the wall/floor types are set. Hence the rest of this post, on how to handle hard-coding of floor/wall types, is not needed.)

tridash tridash

Calculated.

  • Member
    • Member ID: 2,261
  • 299 posts
  • Locationuk

Posted 27 September 2013 - 11:55 AM #59 Blades of Geneforge - How it could be done

floor types etc. aren't hard-coded, they're about where you said they might be (i think walls are at +48908). when i'm a bit more certain of things i'll put details of how they work up.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 27 September 2013 - 05:07 PM #60 Blades of Geneforge - How it could be done

I thought walls and floors were set at offsets 48.920:48.927. But actually altering these bytes seems to affect nothing, even when I start with a new game.
In GF4, the values are:
Rebel Base Docks 0 0 0 0 0 0 0 0
Southforge Citadel 0 0 0 4 255 255 255 255
Upper Southforge 0 1 255 244 255 244 255 244
Citadel Gates 0 0 0 0 0 0 0 0
I don't see any pattern, towns 0 and 3 don't have identical floors/walls.

By contrast, the last two "nav points" look more credible:
0 0 0 0 0 1 0 3 0 0 0 0 0 0 0 0
0 0 0 2 0 1 0 2 0 0 0 0 0 0 0 0
0 0 0 2 0 5 0 2 0 0 0 0 0 0 0 0
0 15 0 0 0 4 0 3 0 0 0 0 0 0 0 0
It would be nice if floors and walls are found at 48,904 through 48,919.
I can start altering them and see if it has any effect.
Edit:
It worked for the first two towns in GF4, now I will try it for GF5. Just as well Tridash was on the ball. I will then go through one Byte (or Short) at a time and see what changes.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 28 September 2013 - 05:14 AM #61 Blades of Geneforge - How it could be done

Comparing towns 0 and 2:
0 0 9 0 4 0 5 0 0 0 0 0 0 0 0 0
0 0 3 0 7 0 2 0 0 0 16 1 1 0 0 0

Changes and their effects:
9 to 3, Wall 1 type changed.
4 to 7, Wall 2 type changed.
5 to 2, outdoor floor type changed.

tridash tridash

Calculated.

  • Member
    • Member ID: 2,261
  • 299 posts
  • Locationuk

Posted 28 September 2013 - 05:34 AM #62 Blades of Geneforge - How it could be done

I wonder if something like a wiki (or maybe just a shared google doc / piratepad) would be a sensible place to keep what's been worked out about the format, otherwise it's getting a bit scattered through the thread.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 28 September 2013 - 06:59 AM #63 Blades of Geneforge - How it could be done

Yes, that would be a good idea. As understanding of data structures improves we will need to re-write our notes...
I still have some stuff to upload about the G5 program itself. Program contains Special Item names, Special Item descriptions, Quest names, Quest descriptions, Intro text and Item Descriptions.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 28 September 2013 - 07:59 AM #64 Blades of Geneforge - How it could be done

Geneforge 5.exe

Generic Item descriptions: 2DD3A0 = 3,003,296

Lists of folders and files written into the program.
These can hopefully be altered to enable the program to directly read a scenario's files.
Altering the name "Scripts" would have the program look for scripts in a folder with the name you specify. (Said name should be no longer than seven letters.)

2D,FFE8 = 3,014,632: Scripts
2E,1290 = 3,019,408: gf5objsmisc.txt gf5itemschars.txt gf5floorster.txt
2E,3524 = 3,028,260: Geneforge 5 Files\Graphics B\G%d Geneforge 5 Files\Graphics A\G%d Geneforge 5 Files\Graphics Core\G%d    .png .jpg .gif .tga .bmp

Unlike BoA some things are written right into the program: Special Item names, Special Item descriptions, Quest names, Quest descriptions, Intro text and Item Descriptions.
Geneforge 5.exe has 256 Byte strings of text, they start no later than offset 3,462,208. There are 1,152 Bytes of blank space before this, it could start as early as 34,D040 = 3,461,184.
I copied all the text into a spreadsheet.

34,D440 = 3,462,208: Creation descriptions. Ends at 3,470,143. Blank space till 3,474,752.
35,0A40 = 3,476,032: start of descriptions of statistics.

0 3,559,232 3,584,832
(100) 3,584,832 3,610,432

Special Item names start: 3,559,232
Special Item descriptions start: 3,584,832

There are 100 possible slots but only about 60 can be used for special items, other 40 are reserved for various G5 game dialogs. Figures above are for the 100 possible slots.
Highest-occurring number for a Special Item is 54: Twisted Key

Quests
Names Descriptions
0 3,710,272 3,735,872 only 256 Bytes available not 512
1 3,710,528 3,736,128 Escape the Fields.
2 3,710,784 3,736,640 Enter Minallah.
3 3,711,040 3,737,152 See Rawal.
4 3,711,296 3,737,664 The Presence.

99 3,735,616 3,786,304
(100) 3,735,872
Not clear if Quest 0 can be used.

Intro texts: 3A0740 = 3,802,944
Graphics are G170 through G173, found in Graphics Core, don't know how to alter this in the program. It could be altered in the graphics folder, by renaming photos.
It ends at 3A193F = 3,807,551.

Item Descriptions: it_extra_description

0 3,815,744 Not clear if this can be used.
1 3,816,000

32 3,823,936
33 3,824,192 Empty

48 3,828,032
49 3,828,288
50 3,828,544 Firebolt, this would seem to be the end of item-descriptions

sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,336 posts
  • LocationPortland, Oregon, United States

Posted 28 September 2013 - 08:31 AM #65 Blades of Geneforge - How it could be done

View Posttridash, on 28 September 2013 - 05:34 AM, said:

I wonder if something like a wiki (or maybe just a shared google doc / piratepad) would be a sensible place to keep what's been worked out about the format, otherwise it's getting a bit scattered through the thread.
If y'all want, I would be willing to host a Mediawiki wiki for this project.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 28 September 2013 - 05:51 PM #66 Blades of Geneforge - How it could be done

Yes, that would be desirable, just like it is for BoA, only more so.
What form it takes is not a big issue, but we need something that is big and that can be updated. What is being learned needs to be collated, all in the one place. It is getting a bit big for one post on this forum.

Sections on the site could include:
How to do things
Workarounds
Calls used by the game
Differences between the BoA and Geneforge games, an awful lot of differences exist.
Structure of the ScenData.dat file
Text and folder parts of the G5 program
How we enable a scenario structure.

sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,336 posts
  • LocationPortland, Oregon, United States

Posted 28 September 2013 - 07:02 PM #67 Blades of Geneforge - How it could be done

Okay, here it is: http://bgwiki.calref.net/Main_Page

I haven't done any content editing, just the set-up. I'll prolly import some big templates like {{infobox}} at some point, but for the most part i'll probably just stick to keeping it running and formatting any minor issues i see with other people's edits :p

Also, I don't think it's really needed but I do have a CI server as well, and since it spends most of its time idle y'all are more than welcome to run jobs on it if need be.

Edited by S▒y░░e▒, 28 September 2013 - 07:03 PM.
If the appropriate persons would inform me when they make an account and give me their username, I will toss out some sysop permissions


Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 28 September 2013 - 10:03 PM #68 Blades of Geneforge - How it could be done

Excellent! We have so much to upload.

TGA files are a type of graphic, they can be opened with IrfanView or the GIMP for starters. I could not find the floor types occurring in the town 0 outdoors, then I did a batch conversion of the Graphics A TGA files...
For the latest version of IrfanView:
http://www.irfanview.com/
(Now I can't find the original TGA files?! Next time do a Batch Conversion using copies of the original files.) No problem, I changed the file association, now they are listed as IrfanView files not TGA.
Next, I need to figure out how the floor graphics relate to the floor types listed in the town record.

Edit:
I just uploaded some Scendata.dat stuff to the Wiki. How do I enter a table?

Edited by Ishad Nha, 29 September 2013 - 04:24 AM.


sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,336 posts
  • LocationPortland, Oregon, United States

Posted 29 September 2013 - 05:05 AM #69 Blades of Geneforge - How it could be done

You can find answers to any formatting questions here (I'll copy this over to bgwiki at some point).

For tables, this code is a decent template:
{|
|  Orange	||   Apple   ||   more
|-
|   Bread	||   Pie	 ||   more
|-
|   Butter   || Ice cream ||  and more
|}

It will produce this:
Posted Image

I would definitely recommend reading the help page on tables to see all the formatting options. Really, the help pages as a whole are quite useful. MediaWiki can do some very useful things, and I've got several useful extensions (ParserFunctions, SMW, etc) that make it even more so

tridash tridash

Calculated.

  • Member
    • Member ID: 2,261
  • 299 posts
  • Locationuk

Posted 29 September 2013 - 08:06 AM #70 Blades of Geneforge - How it could be done

i did a bit of reorganisation, putting the scenario data stuff into a separate page, and added some stuff that may or may not be correct.





Also tagged with one or more of these keywords: Blades of Geneforge, Geneforge, Nethergate, Blades of Nethergate

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users