Empires [ASM, 83+ and Compatables]
Moderator: MaxCoderz Staff
Back to the topic: Work on Empires continues, I'm working on making the file set up correctly. I'm also working on creating, loading, and saving the resources. I'm even writing a function called LoadObject which takes an object equate in A and saves that into the appropriate table slot in memory. However it still has some major errors. But it's a work in progress.
Also, I figured out an equation that will figure out filesize
1031 + (8 * [Characters in Name]) + ( (MapXDIM * MapYDIM) / 2)= Approximate File size
The 1031 comes from tables of data:
;The first 500 bytes represent 100 resource units
;The percentage of these spaces used depends on resource settings.
;
;The next 100 bytes are farm units
;The next 200 bytes are units
;The next 200 bytes are buildings
;
;The second to last 16 are two bytes for each players resources. This is so
;saved games and scenarious can choose how many resources the player starts with.
;These numbers are loaded into ram before starting the engine and updated on save
;The last 15 are unit counts before the map. This is used for compression
1031 + (8 * [Characters in Name]) + ( (MapXDIM * MapYDIM) / 2)= Approximate File size
The 1031 comes from tables of data:
;The first 500 bytes represent 100 resource units
;The percentage of these spaces used depends on resource settings.
;
;The next 100 bytes are farm units
;The next 200 bytes are units
;The next 200 bytes are buildings
;
;The second to last 16 are two bytes for each players resources. This is so
;saved games and scenarious can choose how many resources the player starts with.
;These numbers are loaded into ram before starting the engine and updated on save
;The last 15 are unit counts before the map. This is used for compression
EDIT: This is displaying well because it was meant to be in NotePad and not a forum but it's the best I can do.
Code: Select all
Here's what I've come up with:
X coordinate V Y coordinate S Own Action LO Type Speed
1 2 3 4 5 6 7 1 1 2 3 4 5 6 7 1 1 2 1 2 3 4 1 2 1 2 3 4 5 1 2 3
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Max = 127 1 Max = 127 1 3 |Max 15| 3 |Max = 31 | 7
HP Resource Count
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Max = 255 Max = 255
5 Bytes per unit/building
**X coordinate = The X coordinate for this unit
**V = Valid Flag, Tells the calculator that this unit is no longer valid and it can use this space for a new unit
**Y coordinate = To the Y coordinate for this unit
**S = Status Flag, Tells the calculator that this unit can take damage or not, this could be used for cheat codes, cut scenes, plot characters, etc.
**Own = Owner indicator, indicates who owns this unit
**Action = The action of this unit, Mainly used for AI so it can continue making units carry out actions appropriately so we get a real time effect.
**LO = Left over, could be used for cheat codes, could also be an animation slide.
**Type = The equate for this units type, it could be a building or unit.
**Speed = Movement speed for this unit
**Resource Count = The amount of potential resources this unit has, this applies only to mines, trees, farms, etc....
NOTE: LO is no longer left over, it will be used as a version identifier which will be used to prevent loading map files and units from earlier versions of the game on older versions.
Last edited by Technoman on Wed 11 May, 2005 8:47 pm, edited 1 time in total.
Yes, I have simplified action equates and I'm pretty sure I can do all I need to if 15, maybe 16, 0-15 = 16.
1. Move
2. Attack
3. Defend
4. Gather (Same as farming)
5. Repair
6. Convert
7. Flee
8. No action
9. Building (Same for researching, construction, or creating a unit)
Not quite sure how moving will work or attacking but it will probably be code controlled.
1. Move
2. Attack
3. Defend
4. Gather (Same as farming)
5. Repair
6. Convert
7. Flee
8. No action
9. Building (Same for researching, construction, or creating a unit)
Not quite sure how moving will work or attacking but it will probably be code controlled.