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.
- Viewing Profile: Posts: belgreth
Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics
Community Stats
- Group Members
- Active Posts 36
- Profile Views 862
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
132
Neutral
User Tools
Contacts
belgreth hasn't added any contacts yet.
Posts I've Made
In Topic: Proper way for server to save world data while active?
30 September 2012 - 01:06 PM
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]
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.
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.
- Home
- Viewing Profile: Posts: belgreth