Reputation
367
Top tag
Next privilege 500 Rep.
Access review queues
Badges
4 11
Impact
~14k people reached

Dec
21
comment What data-type should I use for in-game currency?
+1. The only clarification I'd like to add, is just as the financial applications do conform to specific predefined requirements, so does the rounding algorithm. If the game is a casino one, it conforms to similar standards and then double is not an option.
Dec
21
comment What data-type should I use for in-game currency?
it is the purpose of this site to clarify the issues and help the OP make the right decision, depending on the specific scenario. All we can do is help speed up the process :)
Dec
21
comment What data-type should I use for in-game currency?
No apology needed to give a different approach for the same problem :)
Dec
21
comment What data-type should I use for in-game currency?
I only disagree with the part that long is suitable for small calculations. In my real life experience, it has proven enough to handle good precision and large amounts of money. Yes, it might be a little cumbersome to use but it beats BigDecimal in two crucial points - 1) it is faster (BigDecimal uses software rounding, which is way slower that the built-in CPU rounding used in float/double) and 2) BigDecimal is harder to persist in a database without losing precision - not all databases support such 'custom' type. Long is well known and widely supported on all major databases.
Dec
21
comment What data-type should I use for in-game currency?
@Sam, the numbers were provided for the example stake. Still, I've personally seen weird results with such simple numbers, but it is not a frequent scenario. When floating points come to play, this is probably more likely to occur, but more unlikely to spot
Mar
15
comment Is Java viable for serious game development?
Being a long time C# developer (not game developer thought) I believe that pooling and memory management are great issues for any badly designed system. People with the C/C++ mindset and ways of development I know, hardly gasp into the managed memory, design and architecture patterns that must be used and take advantage of them in a language like Java/C#. What I am trying to say, is not that C/C++ techniques or products is bad, but that even if you use simpler languages in terms of syntax (like Java and C#), you still need lots of experience to design your game the right way.
Jan
10
comment Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?
Thanks for the nice and detailed explanations. Yes I forgot to mention, but I will be using XNA.
Jan
10
comment Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?
Thank you for the advice and the video link. Indeed a map seems to be a solution. I myself would attempt to use the map on my top layer to create a 'gap', or to change the effect it has on the underlying objects.
Jan
10
comment Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?
Thanks, I think this is not the effect I am after, but still thanks for sharing :)