Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 28 Jul 2005
Offline Last Active Nov 22 2014 01:41 AM

Posts I've Made

In Topic: I'm desperate. Isometric Mouse Coordinates

06 May 2013 - 01:32 PM

I battled this a LONG LONG time ago back in '08 (took some searching, but here's the thread)
The resolution is below, quoted for proper credit biggrin.png.

its simple really, I'll start from tile--> screen and then see how it goes from screen to tile. Of course you should replace the numbers 64 and 32 by constants for easy change.

tile --> screen
for every tile you go in the X direction you go 64 pixels right and 32 pixels down,
for every tile you go in the Y direction you go 64 pixels left and 32 pixels down,

on screen right=positive x, left=negative x, up=negative y, down = positive y

so we get:
pixel_x = X_LOCATION_OF_TOP_MIDDLE_TILE + 64*tile_x - 64*tile_y
pixel_y = Y_LOCATION_OF_TOP_MIDDLE_TILE + 32*tile_x + 32*tile_y

now to do the screen --> tile
for ease of writing, pixel_x = px, tile_x = tx, X_LOCA... = X0

equation1: px = X0 + 64*(tx-ty)
equation2: py = Y0 + 32*(tx+ty)
we want to find equations for tx and ty when given px and py, so we do some algebra:

eq1+2*eq2 = px+2py = X0+2Y0 + 128*tx
---> tx = (px+2*py -X0-2Y0)/128

eq1-2eq2 = px-2py = X0-2*Y0 -128ty
---> ty = (px-2py - X0+2*Y0) /(-128)

I hope that was clear, and maybe you learned some math from it smile.png

the matrices are just compressed way to do the algebra.

[Edited by - Iftah on December 5, 2008 6:08:28 AM]

In order to get it to work, I had to change the 128's to 64's. It's been forever so I don't remember much of that code, but it should be pretty straight forward.
Hope it helps.

In Topic: Simple MORPG project planning

11 April 2013 - 09:47 AM

Yes, you definitely want to work closely with your client/network programmer(s) on that. If the clients input/physics/animation is not coded with the networking in mind, you're going to have bad times down the road. Building the client and the server each in a vacuum and then "Connecting" them after they're done is... Well, that's probably not the safest approach, we'll say.


Having a log in server to supply an auth ticket is not a problem, but be mindful of how many distinct "Servers" you have. For something small, as you are proposing you probably shouldn't need more than one server application.


I don't see a problem with having the dialogs in the database, but you'll definitely want to keep that stuff cached on the client in some sort of data files so you don't need to stream it constantly.


Your client and server do not need to be written in the same programming language. What's important is that they speak the same "language" over the network. What I mean mostly is your packet structures and protocols (TCP, UDP, HTTP[Probably don't do that], etc...).


Without knowing what sort of data you're storing in your DB, we can make no judgments on it's structure or table counts. So long as it's intelligently designed, and your queries don't have performance issues, you're probably going to be fine. 

In Topic: xna keyboard issues

10 April 2013 - 11:39 AM

As Andy said above, IsKeyDown is what you actually want in that scenario.


If your bullets aren't moving, you're probably not updating their position every frame :)

In Topic: unsure how to make water for my course fishing game for the pc

09 April 2013 - 04:25 PM

I'm not well versed in the 3d side of things, but I have to imagine some sort of plane with some semi-fancy shader magic on it would be one of the simpler paths to take.

In Topic: I want to make a 2D game engine! Where do I start?

09 April 2013 - 04:19 PM

Well, you have quite a few options available to you. 


On the C# side you have XNA/MonoGame which is a pretty great framework that's very easy to get cooking with. You also have Playstation Mobile for Vita/PS Certified Android if you want to go that route.


There's also a ton of C++ options. I found SFML and Allegro 5 to be pretty easy to use, and if you can get the project setup right Cocos2d-X is pretty great as well, although a lot of the tooling is available only on Macs. You could also rough it and go straight to OpenGL/Direct X, but that's probably not the best plan for a 2D project. Of course, SDL is an option, I just personally prefer the more object oriented solutions.


Over in Java land, you also have quite a few options. LibGDX is the only one I'm at all familiar with, but it seems to be pretty feature rich and was rather easy to get going. It's also compatible with Android which I find to be a nice positive.


The number of available programming languages and SDK's is pretty much too great to count so it all comes down to what you want to do and what platform you want to do it on. Already know a language? Find an SDK/API that looks interesting and use it. Want to learn a new one? Go for it!