Tag Info

Hot answers tagged

7

window.localStroage is a more modern alternative to cookies. It allows you to store (semi-)persistent data in the users web browser which will survive a browser restart. The client-sided javascript can access it without having to consult a server, which makes it quite fast to access from the client. But contrary to cookies, localstorage is not directly ...


5

I would probably start with the following schema: Slot (ID, CharacterID, SlotID, ItemID) where Slot is the name of the table ID is the table's primary key CharacterID is a foreign key that points to the character SlotID is the slot's ID going from 1 to 64 (or 0 to 63, or whatever) ItemID is a foreign key that points to the item (ID of a specific ...


4

The overall problem by using any text-based solution is that they are highly unreliable and naive implementations are often prone to data integrity issues. This is where david's suggestion to use a database becomes important. Databases offer you the ability to write entries to a table without worries about concurrent operations from other connections. ...


3

First, your concerns are definitely valid and this is not "premature optimization." The problem is, std::deque::insert invalidates all iterators and references, so deque is not actually useful for this. What I did to solve this problem is create a wrapper data structure around std::vector (I called it a perma_vector) that stores a vector of ...


3

Get the simplest possible example that approaches your expected complexity, running. Code up say 5-6 considerably different behaviours, make entity count variable, and then test at different counts, optimise, and scale up from there. You cannot do game development without prototyping, it is the nature of this profession. You can reduce the complexity of your ...


2

Depending on your needs, you could just serialize a Dictionary to a binary file. I can post some code after I get home, but this link explains the serialization features of C#: http://tech.pro/tutorial/618/csharp-tutorial-serialize-objects-to-a-file This is only secure-ish (a binary file is harder to hack than an excel spreadsheet) but that's all you ...


2

From wikipedia (http://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System#Game_cartridge) The largest games released (Tales of Phantasia and Star Ocean) contain 48 Mbit of ROM data That's 6MBytes. The smallest tile/sprite you could easily store is a 8x8 1bpp tile, giving you (6*1024*1024/8) 786,432 tiles without any space for code and other ...


2

You might want to consider logging to a database, such as MySQL or one of the various "nosql" plain old tables. (If your user base is "massive", there's paths to scaling with more servers or outside services like Amazon or Azure...) In one table, you can have a row for each log entry, and a column with things like the time, the player, the action (log on, ...


2

This is a pretty big question and I think you might be better served by asking each part separately. That said, two of your points (viewport and collision) are essentially about accessing "nearby" objects efficiently. The way to do this is to use some kind of spatial data structure (aka spatial index). The simplest one is to have a two-dimensional array ...


2

Having username in userstats is redundant. You probably would want to key userstats.id_user and users.id_users. userstats.id_stats as auto incremented would be ok to reference from an npc interaction. Remove Coords from userstats. table: playerLocation id_user | playerX | playerY | levelName 1 | 211 | 105 | myMap2 Remove experience from ...


1

There's a few variables that aren't mentioned like how big you expect it to be, what platform the games are going to go on, etc so as usual there's a lot of "it depends" on any answer. One option is to serialize the data out to JSON. If you store some sort of checksum against the data you'll immediately know if the data has been changed. You can also ...



Only top voted, non community-wiki answers of a minimum length are eligible