#gemrb@irc.freenode.net logs for 15 Mar 2013 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage


[01:07:00] --- ermo^ is now known as ermo
[03:30:26] <-- |Blaze| has left IRC (Ping timeout: 252 seconds)
[03:35:05] --> Coriander2 has joined #gemrb
[03:35:34] <-- Coriander has left IRC (Ping timeout: 252 seconds)
[03:36:53] --> |Blaze| has joined #gemrb
[03:41:34] <-- rocket_hamster has left IRC (Remote host closed the connection)
[03:45:19] <-- |Blaze| has left IRC (Ping timeout: 246 seconds)
[03:46:02] --> |Blaze| has joined #gemrb
[04:41:58] <-- edheldil has left IRC (Remote host closed the connection)
[04:48:24] <-- brada has left IRC (Quit: brada)
[04:52:10] --> brada has joined #gemrb
[05:03:29] --- ermo is now known as ermo^
[05:28:33] <-- brada has left IRC (Quit: brada)
[09:12:53] --> edheldil has joined #gemrb
[09:12:54] --- ChanServ gives channel operator status to edheldil
[09:38:10] --> fizzle has joined #gemrb
[10:11:08] --> lynxlynxlynx has joined #gemrb
[10:11:08] <-- lynxlynxlynx has left IRC (Changing host)
[10:11:08] --> lynxlynxlynx has joined #gemrb
[10:11:08] --- ChanServ gives channel operator status to lynxlynxlynx
[11:10:27] --> kida has joined #gemrb
[11:12:24] --> rocket_hamster has joined #gemrb
[11:27:55] <-- Cable_ has left IRC (Ping timeout: 245 seconds)
[11:41:28] --> Cable_ has joined #gemrb
[12:01:51] <-- rocket_hamster has left IRC (Remote host closed the connection)
[12:57:19] --> rocket_hamster has joined #gemrb
[13:39:19] --> WingedHussar has joined #gemrb
[14:08:19] --> brada has joined #gemrb
[14:16:03] <rocket_hamster> anyone here?
[14:19:20] <lynxlynxlynx> mhm
[14:19:54] <rocket_hamster> can i have game dev related question?
[14:20:37] <lynxlynxlynx> you already do
[14:21:01] <lynxlynxlynx> you are the master of your own conscience
[14:21:07] <rocket_hamster> o.O
[14:21:11] <rocket_hamster> speaking in riddles?
[14:21:12] <lynxlynxlynx> and i bet i misspelled that
[14:21:26] <rocket_hamster> yes i mean if i can ask
[14:21:30] <lynxlynxlynx> :)
[14:22:32] <rocket_hamster> if you use IDs for generated objects is it better to have different counter for each object type or share ID counter for all objects
[14:23:11] <rocket_hamster> i mean you can eventually run out of IDs if game lasts long enough
[14:23:34] <lynxlynxlynx> gemrb has shared global ids, so they're unique; differentiation is done by a separate type field when needed
[14:24:31] <lynxlynxlynx> maybe in a mmo, but you can always use larger storage
[14:24:42] <rocket_hamster> what type do you use? 32bit int?
[14:25:03] <rocket_hamster> what if you run out of IDs is there any code to take care of that?
[14:25:26] <lynxlynxlynx> i doubt it, maybe an assert
[14:26:00] <lynxlynxlynx> don't forget that objects are not forever
[14:26:07] <lynxlynxlynx> even diamonds
[14:26:16] <rocket_hamster> so you recycle unused IDs?
[14:28:02] <fuzzie> the id counting starts again when you e.g. load a game
[14:28:15] <lynxlynxlynx> think of the size of unsigned int
[14:28:25] <lynxlynxlynx> we could load all areas and actors and still have free ids
[14:29:48] <rocket_hamster> do you ID sprites and other resources?
[14:30:53] <lynxlynxlynx> not directly, these "global ids" are for high level scriptable objects (actors, doors, containers, traps)
[14:31:11] <lynxlynxlynx> sprites are just their members
[14:31:41] <lynxlynxlynx> they do have some internal unique ids sometimes, since they're cached, but nothing specific
[14:32:13] <lynxlynxlynx> you need to ask yourself what you want achieve with the ids
[14:32:40] <rocket_hamster> well i want and easy way to reference object
[14:32:44] <rocket_hamster> so i dont have to use pointers
[14:32:48] <rocket_hamster> an*
[14:33:50] <rocket_hamster> IDs also eliminate searching for an object i believe and i dont have to use hash either
[14:35:30] <fuzzie> I think pointers *are* the easy way to reference an object.
[14:35:33] <lynxlynxlynx> you can't be more direct than pointers
[14:35:52] <fuzzie> And you have to have a hashtable for your ID list anyway.
[14:35:58] <lynxlynxlynx> for userspace ids are better, but you'll have to resolve them to pointers somewhere anyway
[14:39:08] <rocket_hamster> what if i have a table of elements with pointers and i store IDs
[14:39:20] <rocket_hamster> then i just access array[ID] and have a pointer
[14:40:02] <lynxlynxlynx> that's fine
[14:40:22] <lynxlynxlynx> we also use vectors like that
[14:40:55] <rocket_hamster> lets say i have a class with variable that can have pointers of different object types i would have to cast it to void in order to store and store also object type or is there a better way?
[14:41:13] <rocket_hamster> if you store only one pointer at a time in that variable
[14:42:26] <lynxlynxlynx> we use a superclass
[14:43:14] <rocket_hamster> oh yes, some container class that just stores object type and pointer?
[14:43:48] <rocket_hamster> like sender that can be door, chest or actor?
[14:49:10] <lynxlynxlynx> some more, but yeah
[14:49:22] <lynxlynxlynx> Scriptable in our case
[14:49:54] <fuzzie> rocket_hamster: if you have an array then you have to make sure not to have too high IDs.
[14:50:11] <rocket_hamster> ok thanks, im gonna make a game and rule the world :)
[14:50:39] <rocket_hamster> fuzzie, yes it would be dynamicaly alocated, probably vector
[14:51:22] <fuzzie> if you have an array of 64-bit pointers and you have an id of a high 32-bit integer then you need 32gb of RAM to store your arra.
[14:51:25] <fuzzie> array.
[14:52:04] <rocket_hamster> wow
[14:52:25] <rocket_hamster> this actually is an issue
[14:52:43] <lynxlynxlynx> i don't think we even have a container for all the globals
[14:53:10] <lynxlynxlynx> map has actors / npc / pc
[14:54:09] <rocket_hamster> also im looking for efficient way to determine colision of objects, without comparing every 2 objects on map, i thought about dividing map to certain areas, when object changes coordinates it enters area and only objects in that area or adjacent areas are compared, what do you think?
[14:54:47] <lynxlynxlynx> a very nice problem
[14:55:16] <lynxlynxlynx> since they move, i don't know how helpful spatial indexing can be though
[14:55:17] <rocket_hamster> also i was thinking about some kind of binary tree based on coordinates
[14:55:55] <lynxlynxlynx> a first quick check can be made by just comparing their bounding boxes
[14:56:14] <lynxlynxlynx> if they don't collide, the polygons can't either
[14:56:42] <rocket_hamster> yes but problem is you have to compare every 2 objects
[14:57:04] <rocket_hamster> look someone already thought about it http://en.wikipedia.org/wiki/R-tree
[14:57:05] <Seniorita> R-tree - Wikipedia, the free encyclopedia
[14:58:08] <lynxlynxlynx> knn indexes are even better
[14:58:24] <lynxlynxlynx> but this was all made for gis, where things don't moce
[14:58:25] <lynxlynxlynx> move
[15:12:09] <rocket_hamster> oh
[15:12:31] <rocket_hamster> so i would have to run algorithm everytime something moves and i guess its rather complicated one
[15:12:59] <rocket_hamster> static parts of map would be better imo
[15:37:11] <lynxlynxlynx> i'd search on gamasutra and other gamedev sites
[15:51:12] <psch> brada: mouse input on android seems to work without additional changes
[15:51:34] <psch> and i found out my bluetooth keyboard sends ^C when it connects or disconnect, which is kinda dumb
[16:00:01] <-- WingedHussar has left IRC (Quit: WingedHussar)
[16:07:29] <lynxlynxlynx> heh
[16:15:33] <brada> cool
[16:16:15] <psch> the buttons don't change displayed state, but they react fine
[16:16:20] <psch> menu buttons that is
[16:18:43] <edheldil> psch: be glad it does not send "Ctrl-F2 format c:" or st. like that :-D
[16:20:01] <psch> true
[16:20:42] <psch> further research does suggest it doesn't actually send ^C but the connection event inside android sends something that gemrb interprets as ^C
[16:20:50] <psch> which is definitely something i should look into
[16:42:25] <-- fizzle has left IRC (Remote host closed the connection)
[16:43:34] <edheldil> brobably a break
[16:44:53] --> fizzle has joined #gemrb
[16:46:18] <-- rocket_hamster has left IRC (Remote host closed the connection)
[17:16:20] <-- brada has left IRC (Quit: brada)
[17:45:57] --> brada has joined #gemrb
[18:01:54] <-- fizzle has left #gemrb
[19:04:31] <-- brada has left IRC (Quit: brada)
[19:37:04] --> rocket_hamster has joined #gemrb
[20:32:19] --> brada has joined #gemrb
[20:48:39] --> Yoshimo has joined #gemrb
[20:49:33] <-- Yoshimo has left IRC (Client Quit)
[20:59:26] <-- rocket_hamster has left IRC (Remote host closed the connection)
[22:15:06] --> lynxlynxlynx_ has joined #gemrb
[22:15:06] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[23:37:10] <-- lynxlynxlynx_ has left IRC (Remote host closed the connection)
[23:43:46] <-- Coriander2 has left IRC (Read error: Connection reset by peer)