Rick's Blog

Font size: +

Life On The Farm - Episode 2 - Structure

Life On The Farm

The first task was to design an overall program structure that would share data efficiently between the server (running node.js), the game board (planned to be served in a web browser) and several player mobile devices (also in web browsers).   

Overall Program Structure

The game board and the player interface should be relatively siimple; an HTML structure running javascript with OpenGL for the visual elements, and using socket.io to transfer messages back and forth to the node.js server.   The main program will be mainly responsible for managing messages.  

Inside the main program will be a Game Class.  The Game object will be responsible for managing all of the generic game activities (keeping track of turns, handing out cards when required, tracking player locations on the board, etc.).  The Game object will contain an array of Player Class Objects.

The Player object will be responsible for keeping track of each player's details (current position, assets, score, which mobile connection corresponds to the player, etc.)

I considered duplicating the Game and/or Player class in both the Player and the Board.  That would require constantly synchronizing the objects which turned into a lot of overhead that wasn't really necessary.  The current plan is to have a single master object and pass information when required.  Sort of a Just In Time data delivery system! 😊

The first draft player interface will be simple text.  The first draft of the game board will need to be OpenGL to help with future development.  The lesson learned from my failed first attempt will be to keep the visuals simple until game play is working.  

 Next Step:  Getting the basic game logic working!🤷🤞

×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Life On The Farm - It's All About the Visuals
Create a Game - Life on the Farm - Take 2

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Sunday, 04 December 2022

Captcha Image

Rick's Blog

Font size: +

Life On The Farm - Episode 2 - Structure

Life On The Farm

The first task was to design an overall program structure that would share data efficiently between the server (running node.js), the game board (planned to be served in a web browser) and several player mobile devices (also in web browsers).   

Overall Program Structure

The game board and the player interface should be relatively siimple; an HTML structure running javascript with OpenGL for the visual elements, and using socket.io to transfer messages back and forth to the node.js server.   The main program will be mainly responsible for managing messages.  

Inside the main program will be a Game Class.  The Game object will be responsible for managing all of the generic game activities (keeping track of turns, handing out cards when required, tracking player locations on the board, etc.).  The Game object will contain an array of Player Class Objects.

The Player object will be responsible for keeping track of each player's details (current position, assets, score, which mobile connection corresponds to the player, etc.)

I considered duplicating the Game and/or Player class in both the Player and the Board.  That would require constantly synchronizing the objects which turned into a lot of overhead that wasn't really necessary.  The current plan is to have a single master object and pass information when required.  Sort of a Just In Time data delivery system! 😊

The first draft player interface will be simple text.  The first draft of the game board will need to be OpenGL to help with future development.  The lesson learned from my failed first attempt will be to keep the visuals simple until game play is working.  

 Next Step:  Getting the basic game logic working!🤷🤞

×
Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

Life On The Farm - It's All About the Visuals
Create a Game - Life on the Farm - Take 2

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Sunday, 04 December 2022

Captcha Image