Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


belgreth

Member Since 11 Mar 2010
Offline Last Active Oct 12 2012 06:48 PM

Posts I've Made

In Topic: Proper way for server to save world data while active?

30 September 2012 - 01:06 PM

Hm, writing to a MemoryStream then sending that off sounds like a solution, thanks hplus.

As far as world data, it's split into cells and players can change most aspects of it so I have to save everything, at least the active cells.

You bring up a good point about item duplication...but I'm not at that hurdle yet. My server/client is small scale (think minecraft). It's aimed for 2-8+ people to play together in a persistent world. I'm trying to stay away from having to deal with databases like mySQL as I'm mostly illiterate in that area. If I can just keep everything saved in binary, that would be ideal.

In Topic: Issue with scissorrectangle

27 August 2012 - 07:05 PM

I don't believe so. Isn't that what SpriteSortMode.Deferred means? No z sorting, just draw everything on top of each other in draw call order? Plus I'm not specifying a depth when drawing any element

i.e.
[source lang="csharp"]sb.Draw(mapBiomeColorTexture, mapRect, new Color(1, 1, 1, 0.2f)); [/source]

In Topic: My lock()s don't appear to be working.

22 July 2012 - 03:14 PM

I decided to put the received message processing back into the main thread. I am unsure why I originally had a separate thread that only processed incoming messages from the server. I'm also unsure what I was thinking when I put the whole draw call into the lock when I could've just held the lock long enough to copy the world variable into a temp matrix and then call draw...

I already have 2 threads for networking, one that only listens, and stuffs the packet into a list and immediately goes back to listening and another thread that just decodes the packets into messages. My locks for those things seem to be working as I haven't had any race conditions or out of index errors yet. In fact there's no need for the second thread as well, I can stuff that into the main thread too.

I agree, keeping it simple is best. I am not aware of polling so I'll definitely be looking into that. Thanks for the reply rip-off.



EDIT: Well after putting the message processor in the main thread I was still having the same issue so apparently the locks weren't the problem to begin with! The direction wasn't getting normalized for the player when calling

unitContainer.otherPlayers[index].Direction.Normalize();

It works when I did:

unitContainer.otherplayers[index].Direction = Vector3.Normalize(unitContainer.otherplayers[index].Direction);

If anyone has any idea why the first one didn't work I'd love to know.

In Topic: In-game map techniques?

12 July 2012 - 11:32 PM

Thanks for the replies jeffery, that might actually fit my needs. I dont need elevation, more symbolic than anything topographic-wise. I'll try generating a low rez version of the world and use an orthographic camera and see how that works out. This'll even let me do some lighting so it's not plain looking.

In Topic: In-game map techniques?

12 July 2012 - 09:34 PM

Depending upon the technology used, I would think you could just render the map using a separate camera facing down in orthographic mode with low resolution, low LOD, skip animated models and most effects turned off. You could put a mask in a texture for a shader to do fog of war.


Hm, that won't work for viewing the whole world (as it would be too much to draw) however I do like that idea for a local 'radar' type map *adds to todo list*. I'm looking for a decent looking full world map that can be zoomed and scrolled around and possibly have highlightable icons on it. The icons and zooming/scrolling I can figure out, I just need something that isn't plain and boring to look at.

PARTNERS