124 lines
4.2 KiB
Plaintext
124 lines
4.2 KiB
Plaintext
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
Notes on Organization and Compilation
|
|
````````````````````````````````
|
|
Project layout:
|
|
engine/ - Game engine
|
|
tile_editor/ - Tile editor
|
|
modules/ - Game files used by the engine and tile_editor
|
|
tools/ - Extraneous tools for data packing and similar
|
|
common/ - Contains all shared or commonly used code, such as data I/O,
|
|
extensions to C, new data types, etc.
|
|
test/ - Location for developing new feature and testing concepts
|
|
old/ - Old Wait-based game engine
|
|
devcpp/ - Dev-C++ project for Windows
|
|
xcode/ - XCode project for OS X
|
|
|
|
Compiling:
|
|
make engine - builds Game engine
|
|
make tile_editor - builds tile_editor
|
|
make tools - builds tools
|
|
make old - builds old Game engine
|
|
|
|
Compiling(OS X): open xcode/timesynk.xcodeproj and set the Active Target to:
|
|
engine for Game engine
|
|
Tile Editor for the tile editor
|
|
timesynk for the old Game engine
|
|
|
|
Compiling(Windows): open an appropriate devcpp/*.dev project and Compile
|
|
engine.dev for Game engine
|
|
tile_editor for tile editor
|
|
timesynk-sdl for old SDL Game engine
|
|
timesynk-pdcurses for old PCurses Game engine
|
|
|
|
Cleaning:
|
|
make clean - cleans entire project
|
|
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
Notes on Engine Requirements
|
|
````````````````````````````````
|
|
Timesynk uses a limited virtual machine for Tile logic and handling User input. This is implemented in a limited Object-Oriented programming language, providing access to common data types and a handful of timesynk-specific types (Tile, Map, Player, and similar).
|
|
|
|
Data types provided:
|
|
''''''''''''''''''''''''''''''''
|
|
* Char
|
|
- single byte, used for ASCII chars
|
|
* Int
|
|
- basic number, likely 4-bytes, can translate from/to Int
|
|
* Float
|
|
- non-real number, can translate from/to Int
|
|
* Table (pointer, not handled by VM directly)
|
|
- Dynamic "Associative" array
|
|
* String (pointer?)
|
|
- variable size char "array"
|
|
* Tile (pointer, not handled by VM directly)
|
|
- provides access to Tile structs,
|
|
* Map (pointer, not handled by VM directly)
|
|
- provides access to Maps and their Tiles
|
|
* Player (pointer, not handled by VM directly)
|
|
- provides information on a player, including owned Tile(s)
|
|
|
|
Important global variables provided are:
|
|
''''''''''''''''''''''''''''''''
|
|
* Int player_count
|
|
- count of players in-game
|
|
* Table *players
|
|
- Table of players, accessed by ID(player_count) or by name
|
|
* Map *map
|
|
- current map containing Tile(s) and pertinent information
|
|
* Table *maps
|
|
- Table of all live maps traversed. On save, serialized to disk
|
|
* GameInfo game_info
|
|
- struct of game information, such as ip, port, players, etc.
|
|
|
|
Global functions
|
|
''''''''''''''''''''''''''''''''
|
|
* Int setSeed(Int seed)
|
|
- sets the seed for Random-based functions. Must be same for all players.
|
|
* Int RandomInt(Int min, Int max)
|
|
- returns a random number from min to max
|
|
* Float RandomFloat(Float min, Float max)
|
|
- returns a random float form min to max
|
|
* Int RollDice(Int dice, Int faces)
|
|
- rolls dice :)
|
|
|
|
Basic OO access functions, *~ = user-provided, * = built-in
|
|
''''''''''''''''''''''''''''''''
|
|
* Player
|
|
*~ onInput(Input input)
|
|
- ???
|
|
*~ onDisconnect()
|
|
- ???
|
|
*~ onConnect()
|
|
- ???
|
|
*~ onMessage(Message ???)
|
|
- receive message from other player?
|
|
* ownTile(Tile target)
|
|
- ???
|
|
* disownTile(Tile target)
|
|
- ???
|
|
* doMessage(Player ???, Message ???)
|
|
- send message to other player?
|
|
|
|
* Tile(Int type, Int id)
|
|
*~ Int onCreate()
|
|
- ???
|
|
*~ Int onDestroy()
|
|
- ???
|
|
*~ Int onThink()
|
|
- provided by developer, used as jump-point for all logic
|
|
*~ Int onTouched(Tile other)
|
|
- triggered when touched by another Tile, if non-zero returned, block other's movement
|
|
*~ Int onTouch(Tile other)
|
|
- trigger when touching another Tile, comes before onTouched
|
|
* Int doMove(Float x, Float y, Float z)
|
|
- attempts to move Tile in a direction, calling doTouch
|
|
* Int doTouch(Tile other)
|
|
- touches the provided Tile, regardless of distance, triggering self.onTouch and/or other.onTouched
|
|
|
|
* Map(Int width, Int height, Int depth)
|
|
*~ Int onCreate()
|
|
- ???
|
|
*~ Int onDestroy()
|
|
- ???
|
|
* Int addTile(Tile tile, Float x, Float y, Float z)
|
|
- add Tile to x, y, z
|