Coronium Ace - Game Ready

Dev,

I have a table (read only) called scoreTable = { 5, 5 ,5, 25, 40 ,50} on the server.  I want to deliver this table to each of the clients on game ready event. I thought the ‘hook’ would be the place to do that, but I was not clear on the instructions that are on the ace site(I did read them). 

I tried putting this table ‘scoreTable’ in the game_objects table in config file, and I can access that table on the server just as the instructs say to. But that is not the problem.

I want to send that table info to the clients on ‘gameready’.  If I leave that table in the game_objects table, any calls to Ace.debug on the client does not show that table.  And I cannot find any client side API call that will pull that table.  If i put that table in game_state, Ace.debug on client of course shows gstate table, but not the scoreTable.  Can I not embed tables in the game_state table?

What might be best for sending this scoreTable to the clients on ‘gameready’?

I would prefer to keep it out of game_state table, as I think that table should be as small as possible, since it gets sent to the clients often.

Regarding the editor on the server. It is great. But I was wondering, when I leave the game module to look at the output log or to go to the config module, and return to game module, it always puts me at the top of the module.  Can you have it so cursor position is saved when moving between the modules and the output screen?

New Modules, the way I read the instructions on this, it is just new game modules that can be created; how would I create a new module in my present game (to break the code down into manageable files), and then ‘require’ the module into my game module… like I do in my corona projects?

When I first started testing Ace, there were 2 plugins that were instructed to be put in build.settings, but since the start you provided the ace plugin, should I remove those original 2 plugins from build.settings?

Thanks

Bob

In testing I added simple number field and a simple string field to the init_ game_state table just to see if they would show on debug call on client and they do not.  Not sure what could be the issue, since I play the game through and it functions as it has been prior to this issue.  Not sure how, but maybe trying to add the scoreTable to (originally) game_objects, then to init_game_state, somehow glitched something up.

Hi,

Sorry for the late response, was away for the weekend. 

1. I want to deliver this table to each of the clients on game ready event.

I would put this table in the init_game_state. It will be passed automatically when the game is ready. The GameReady hook is for configuring initial state that may be more dynamic in nature. For instance a random number or the like.

On the client-side GameReady event you should be able to call ace.getState().scoreTable to access it.

2. If I leave that table in the game_objects table, any calls to Ace.debug on the client does not show that table.

The game_objects table is server-side read-only.

3.I would prefer to keep it out of game_state table, as I think that table should be as small as possible, since it gets sent to the clients often.

Good observation. If it were me, I would keep the scoreTable in the init_game_data and update the scoreTable as needed by having the client send some type of flag, or the minimum you need to determine the score. You could keep the current score that you want to display in the game_state itself, which is always propagated to the clients.

If you would like an example of this method, let me know.

4. Can you have it so cursor position is saved when moving between the modules and the output screen?

I’ll see what I can do, should be possible.

5. How would I create a new module in my present game.

This functionality is not available at the moment because the way modules are handled is very different from Coronium Core. In CC, modules live as physical files. With Ace the modules reside in memory for quick access and simple scalability.

There is a fine balance that needs to be factored in when creating the multi-player games. Though it is best to try and keep logic on the server-side, if that will cause the file to become to large, then some of the logic should be off-loaded to the client and then use flags to update state. The smaller the server-side code, the better.

6.  …should I remove those original 2 plugins from build.settings?

No, all the plugins are still required.

7. I added simple number field and a simple string field to the init_ game_state table just to see if they would show on debug call on client and they do not.

I will take a look. Just to double-check, did you save and then push?

Thanks for your help, it is early beta so there are sure to be some kinks that need to be ironed out. I appreciate your time and feedback.

-dev

Thank Dev

#7

yes I did save and push and got ‘successful’   tried this several times with simple changes to the init_game_state table and they did not appear in the table when client pulled it up with Ace.debug on game-ready or game-state on the client.

#3 & #1

I agree with your thoughts on that, but since I use that scoreTable as kind of a ‘lookup table’, I thought, it made sense to send that once on game-ready. Then each client could copy that and I would not need it sent each game-state, or make calls to the sever to access that table.  it is a small table, but I like the concept of the ‘hook’ at game-ready being able to send something each client can store to be referenced on the client during game play rather then making calls to the server to get that ‘lookup type’ info. 

This is not a critical issue. There are certainly work arounds to the issue… including sending flags to the server tapping into such tables as you mentioned. I can tag objects with such values as would be in the lookup tables as well.

Thanks

Bob

In testing I added simple number field and a simple string field to the init_ game_state table just to see if they would show on debug call on client and they do not.  Not sure what could be the issue, since I play the game through and it functions as it has been prior to this issue.  Not sure how, but maybe trying to add the scoreTable to (originally) game_objects, then to init_game_state, somehow glitched something up.

Hi,

Sorry for the late response, was away for the weekend. 

1. I want to deliver this table to each of the clients on game ready event.

I would put this table in the init_game_state. It will be passed automatically when the game is ready. The GameReady hook is for configuring initial state that may be more dynamic in nature. For instance a random number or the like.

On the client-side GameReady event you should be able to call ace.getState().scoreTable to access it.

2. If I leave that table in the game_objects table, any calls to Ace.debug on the client does not show that table.

The game_objects table is server-side read-only.

3.I would prefer to keep it out of game_state table, as I think that table should be as small as possible, since it gets sent to the clients often.

Good observation. If it were me, I would keep the scoreTable in the init_game_data and update the scoreTable as needed by having the client send some type of flag, or the minimum you need to determine the score. You could keep the current score that you want to display in the game_state itself, which is always propagated to the clients.

If you would like an example of this method, let me know.

4. Can you have it so cursor position is saved when moving between the modules and the output screen?

I’ll see what I can do, should be possible.

5. How would I create a new module in my present game.

This functionality is not available at the moment because the way modules are handled is very different from Coronium Core. In CC, modules live as physical files. With Ace the modules reside in memory for quick access and simple scalability.

There is a fine balance that needs to be factored in when creating the multi-player games. Though it is best to try and keep logic on the server-side, if that will cause the file to become to large, then some of the logic should be off-loaded to the client and then use flags to update state. The smaller the server-side code, the better.

6.  …should I remove those original 2 plugins from build.settings?

No, all the plugins are still required.

7. I added simple number field and a simple string field to the init_ game_state table just to see if they would show on debug call on client and they do not.

I will take a look. Just to double-check, did you save and then push?

Thanks for your help, it is early beta so there are sure to be some kinks that need to be ironed out. I appreciate your time and feedback.

-dev

Thank Dev

#7

yes I did save and push and got ‘successful’   tried this several times with simple changes to the init_game_state table and they did not appear in the table when client pulled it up with Ace.debug on game-ready or game-state on the client.

#3 & #1

I agree with your thoughts on that, but since I use that scoreTable as kind of a ‘lookup table’, I thought, it made sense to send that once on game-ready. Then each client could copy that and I would not need it sent each game-state, or make calls to the sever to access that table.  it is a small table, but I like the concept of the ‘hook’ at game-ready being able to send something each client can store to be referenced on the client during game play rather then making calls to the server to get that ‘lookup type’ info. 

This is not a critical issue. There are certainly work arounds to the issue… including sending flags to the server tapping into such tables as you mentioned. I can tag objects with such values as would be in the lookup tables as well.

Thanks

Bob