Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Mar 2012
Offline Last Active May 23 2013 12:54 AM

Posts I've Made

In Topic: circular gravity

27 March 2012 - 11:33 PM

Using a polar coordinate system for the physics should simply things a lot.

In Topic: Ticks in PHP Games

27 March 2012 - 12:48 PM

What bothers me is that, one of the core features of the game will be trade, and with that you need a market place with lists of buy and sell orders. These will need to be kept up to date and every time the user visits the 'market.php' page it will have to do a search query and update it accordingly. I'm worried this could take very long and by the time the user chooses to buy or sell something, the data has changed and they'll get the wrong order when they submit.

You need to queue the orders and process them one at a time. Read from the database only if the values have been changed. Otherwise, display it from the cache like what you've said.

In Topic: how much faster si udp

27 March 2012 - 12:36 PM

If there is no packet loss, then TCP and UDP are exactly the same speed.

Even if there's no packet loss, TCP requires the receiver to send acknowledgements of received data.

In Topic: Java or C++?

22 March 2012 - 12:18 PM

Try to stick with facts, rather than opinions.

Posted Image

Consider virtual machines, if you look back a few years and see the performance difference between what they were then and where they are now - you will see that most of the "performance issues" are actually implementation issues.

It's so easy to blame everything on implemention. It's a catch-all phrase for defending anything that's wrong with a particular tool. One could argue that the performance issues of C/C++ is related to implementation too. If the compilers were made better, C/C++ would always be extremely far ahead of Java in performance.

Java's main performance pitfall is the memory structure - it suffers because it doesn't allow explicit value objects and AFAIK little or no memory layout optimisations are done automatically. This is where 95%+ of modern performance issues are - memory layout problems causing the busy loops to fall outside the cache.

Regardless of whether or not the percentage is correct, you've admitted yourself that Java is an inadequate language, performance-wise.

And of course if you allow C or C++ that, then surely you must allow Java, C# or even Javascript the same, and you are back to where you started.

However unless you are in the business of writing operating systems I don't see any relevance of this line of reasoning.

There's a huge difference between a little abstraction and 100% abstraction. And if Java is so good, it would've been used for coding commercial operating systems

In Topic: AI for simple Bomberman game

22 March 2012 - 11:31 AM

You could try one or more of the following:

1) Check the distance of the player to the bot. If the player is too close to the bot, the bot should avoid placing bombs and focus on running away.
2) Use the pathfinding algorithm (A*). If there isn't a path of escape to safety, don't put the bomb. If a path leads to a dead end, the bot should avoid it.
3) Make the map bot-friendly. Add hidden triggers or location markers on the map to make it an ideal bomb site.