kts
|
7bc43929e0
|
Added much code for the foundation of the netcode. Server automatically starts on port 31337 and runs as a separate thread in the SDL client. This TCP server functions as a basic echo server and can be connected to thru telnet or by typing 'connect 127.0.0.1 31337' in timesynk's console. Once connected, the echo functionality can be tested by using console command 'send my message goes here'. Somewhat buggy and crashses on occasion - suspected cause is consoleLog()ing a string that is not properly nul terminated, resulting in reading memory out of bounds. Curses client does not run the server properly at the moment, probably due to using select on server, clients, and stdin when combined with ncurses - will look into this later.
|
2013-11-06 23:40:19 -08:00 |
kts
|
df73d846d8
|
Both SDL and curses clients work on WIN32/64. The SDL client is fully working, as is expected, but the gameLoop timer/signal system does not work. The code is in place via preprocessor conditions but it would require a fake window to be created so the messaging system can be used.
|
2013-11-04 11:59:49 -08:00 |
kts
|
8fc710f3a2
|
Successfully recoded both SDL and curses client to use a model that ticks the world according to a Tick Event/Signal. How this works in SDL is a simple SDL Timer that pushes an SDL_USEREVENT with a code of EVENT_TICK at some interval in ms. The curses client works by calling setitimer with tickSignal as a callback, triggering whenever a SIGALRM signal is given. This was chosen for maximum cross-compatability for POSIX platforms, even though Linux has excellent timer fd support. Both the SDL and curses interfaces can have their tickrate modified by calling tickrate some_number_in_ms from the console. 0 stops the timer. For all of this to work, main() no longer has the while loop contained in it, but rather calls interfaceLoop() and lets the interface handle it (as this is extremely platform/api specific - some platforms have user input strongly tied into the drawing window (SDL), so we cannot use a monolithic select()-style while loop for all). Much more to be cleaned up, but this sets the foundation for network code.
|
2013-11-04 02:32:07 -08:00 |
kts
|
4c204db4f3
|
Added support for doors. A DoorTile is a fairly basic tile - at the moment - sporting a state int to specify its current state via STATE_OPEN, STATE_CLOSED, STATE_BROKEN, or STATE_MISSING. Graphically/ascii-ly, the proper visual appearance is acquired by multiplying the door id by the total door states(4) and adding the current state value to the result. For example, for a door with the id of 0, you would have visual tile 0 for closed, 1 for open, 2 for broken, and 3 for missing. Beyond the doors, the curses tiles were moved from interface/curses.(c/h) to tiles/curses_tiles.(c/h) - they should, at some point, be generated in a similar manner to the tiles for the SDL client (using pack_tiles).
|
2013-10-17 15:11:29 -07:00 |
kts
|
e1a32045cf
|
Added a ton of stuff, SDL compile is broken, probably due to malloc issues. Must check over code in different environments.
|
2013-10-08 21:49:38 -07:00 |
kts
|
2d7a45e0b5
|
Map now resides on a multidimensional array titled map_matrix. This stores the Tiles in a Stack structure at each cell - I believe this should instead be changed so that each Tile instead has pointers to the previous and next Tiles, so that the map_matrix only holds Tile pointers rather than Stack structs containing some variable amount of Tile pointers. Also added a visible_matrix that denotes what tiles are visible to the player. This is simply a multi-dimensional array of ints that act as bit fields for various flags (such as TILE_VISIBLE, TILE_CAN_SEE, TILE_LIGHT_ONE, TILE_LIGHT_TWO, etc. - multiple light flags can be concatted to provide a broad array of light levels).
|
2013-09-28 20:50:52 -07:00 |
kts
|
0c5dc4c822
|
Initial commit, contains a barebones structure with the interface for both (x)curses and SDL. Can be built via the Makefile or via the XCode project in the xcode/ subdirectory
|
2013-09-17 22:37:36 -07:00 |