case ServerNotificationType::startGameMode:

case ServerNotificationType::startGameMode:

Postby paul424 » 29 May 2016, 10:06

I have a question regarding ODClient.cpp and it's client -server architecture :
When ServerNotificationType::startGameMode: token is passed between server and a client ? BEFORE or AFTER GameMode is initialized ?
For me it seems it is before , because some of the GameMode objects ( Minimapcamera ) is not initialized at that point.

What is the proper point in ODClient to insert startTileCulling ? I need GameMode to be initialized .
IS there some point where GameMode just has been initialized ?
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby hwoarangmy » 29 May 2016, 10:26

ServerNotificationType::startGameMode is the message asking the client to... start game mode ;)

Basically, it happens after seat configuration is set up. Concerning where to start culling, I would say within the game mode do not seem a bad idea since both functions are client side only.
hwoarangmy
 
Posts: 565
Joined: 16 Apr 2014, 19:13

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 29 May 2016, 16:53

GameMode seems to be outside agnositc , it doesn't contain any pointers to outside objects . This is called low-coupling if I remember correctly. COuld we leave that and just implement symmetrical message ServerNotificationType::gameModeStarted ; from which I would call my starttileculling ? If so could you implement that ? BTW who implemented the client -server architecture ?
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby hwoarangmy » 29 May 2016, 21:35

paul424 {l Wrote}:GameMode seems to be outside agnositc , it doesn't contain any pointers to outside objects
Not really. It uses ODFrameListener using its singleton get method. And ODFrameListener calls everything else. Moreover, other Singletons are called in the modes (TextRenderer, RenderManager, ...).

paul424 {l Wrote}:This is called low-coupling if I remember correctly
No, low coupling is splitting a class definition and its implementation. Basically, it consists as defining an abstract class with as few implementation as possible. For an example, you can have a look at GameEntityListener and how it is used.

paul424 {l Wrote}:COuld we leave that and just implement symmetrical message ServerNotificationType::gameModeStarted ; from which I would call my starttileculling ?
No. Basically, ServerNotificationType are used by the server to notify the client of new server events. For example, ServerNotificationType::startGameMode is thrown when the seats are configured (faction, team, ...). Once it is done, the client switches to game mode and starts playing. Launching game mode is client side event so there cannot be any message from the server for that.

paul424 {l Wrote}:BTW who implemented the client -server architecture ?
I did.

Note that AFAIK, there is no reason not to implement culling for the editor (correct me if you see some). If you implement culling for both editor and game modes, you can have a look at GameEditorModeBase which is the base class for common things.
hwoarangmy
 
Posts: 565
Joined: 16 Apr 2014, 19:13

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 30 May 2016, 10:31

I did a little test , tough thing you know : the tiles in the minimap appear and disapear with a delay ..... for a second there is a black space ... this seems unacceptable , right ?
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby hwoarangmy » 30 May 2016, 13:46

Well, I'm not sure what you mean but if you say there is a noticeable glitch, no, it is not acceptable. However, if you can manage to get a list of not visible tiles, you can easily show/hide them while rendering the minimap.

Can you have the list ?
hwoarangmy
 
Posts: 565
Joined: 16 Apr 2014, 19:13

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 30 May 2016, 14:08

I can,

I get black bits on screen , just before the tile of terrain is supposed to appear .
I will post this evening video showing what's the problem .
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 30 May 2016, 18:18

http://www.dailymotion.com/video/x4di24s
The main map does not matter.
This is what I get with miniMapCamera. Notice the slow time of tiles refreshing in minimap Window.
It's especially strange, because when culling with gameMap window the code manages to set tiles on time .
Ain't the minimap drawing with some delay than ?
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby hwoarangmy » 30 May 2016, 19:20

Well, that's much better than I expected from what you said.

paul424 {l Wrote}:Ain't the minimap drawing with some delay than ?
Yes, there is a delay in MiniMapCamera::update. ATM, it is set to 0.5 seconds min between 2 refreshes. I guess you can somehow manage to allow a shorter refresh time when the camera moves. However, note that refreshing the minimap is one of the most CPU consuming tasks we had according to a profiler I ran so we should avoid to refresh it when not needed.


paul424 {l Wrote}:It's especially strange, because when culling with gameMap window the code manages to set tiles on time
I don't get what you mean here.
hwoarangmy
 
Posts: 565
Joined: 16 Apr 2014, 19:13

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 30 May 2016, 19:45

ATM, it is set to 0.5 seconds min between 2 refreshes.

I don't understand either. Can you hang on IRC sometimes ?
After experimenting with static const Ogre::Real MIN_TIME_REFRESH_SECS = 0.05; I manage to correct the situation a little . How much glitching is acceptable ?
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 31 May 2016, 08:24

http://www.dailymotion.com/video/x4dlne2

Now the glitching is smaller although still persist.
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby hwoarangmy » 31 May 2016, 09:08

Concerning the minimap, that sounds acceptable to me. However, on the main map, the tiles are not displayed, even when you stop moving. Do you know why ?
hwoarangmy
 
Posts: 565
Joined: 16 Apr 2014, 19:13

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 31 May 2016, 09:43

That was just the testcase, the tileculling for both is not working yet :) .
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Re: case ServerNotificationType::startGameMode:

Postby paul424 » 03 Jun 2016, 13:33

now , IT WORKS !! , IT WORKS , will do a merge request asap.
User avatar
paul424
OD Moderator
 
Posts: 639
Joined: 24 Jan 2012, 13:54

Who is online

Users browsing this forum: No registered users and 1 guest