Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Scaevolus
Apr 16, 2007

Hanpan posted:

After that, I tried out pygame and some of the libraries associated with 2d gaming. It's nice but I ran into the same performance problems I encountered with Flash.

It seems to me the only real way to get the performance I want is to either build something for scratch. Does anyone know of any other engines out there I could try?

Have a look at Pyglet & Rabbyt.

Adbot
ADBOT LOVES YOU

Hanpan
Dec 5, 2004

Scaevolus posted:

Have a look at Pyglet & Rabbyt.

Isn't Python similar to Flash in regards to performance? I'd really like get some parallax scrolling on the go and all sorts.

Star Warrior X
Jul 14, 2004

SDL is my go-to for cross platform 2d, especially if performance is key.

Scaevolus
Apr 16, 2007

Hanpan posted:

Isn't Python similar to Flash in regards to performance? I'd really like get some parallax scrolling on the go and all sorts.

Pyglet uses OpenGL, so it should have better performance than Flash or Pygame's software rendering.

nolen
Apr 4, 2004

butts.

Hanpan posted:

I've tried Torque2d, which is terrible, as well as attempting to modify Unity which isn't really engineered with 2D games in mind (it's annoying having to model 3d objects for a simple platform.)

I use this for 2D game development in Unity3D:

http://www.anbsoft.com/middleware/sm2/

Just create empty GameObjects with BoxColliders and attach a Sprite to them. Tada!

Evil Trout
Nov 16, 2004

The evilest trout of them all

Hanpan posted:

Isn't Python similar to Flash in regards to performance? I'd really like get some parallax scrolling on the go and all sorts.

Did you find that Flixel couldn't handle parallax scrolling? I'm using it for a small project and I have 4-5 layers of parallax at 60fps.

Morpheus
Apr 18, 2008

My favourite little monsters
Could someone direct me to a tutorial on Modal Windows? In XNA/C# if possible. Basically I just want to be able to make a line of code that's essentially:

window = new Dialogue("WHAT DIRECTION")
direction = window.returnDirection();

Where that dialogue will open up a window, ask the user to press a direction, loop within the window until the user presses a direction, and then most importantly, return the direction that was pressed.

I'm not entirely sure I'm describing this correctly.

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

Morpheus posted:

Could someone direct me to a tutorial on Modal Windows? In XNA/C# if possible. Basically I just want to be able to make a line of code that's essentially:

window = new Dialogue("WHAT DIRECTION")
direction = window.returnDirection();

Where that dialogue will open up a window, ask the user to press a direction, loop within the window until the user presses a direction, and then most importantly, return the direction that was pressed.

I'm not entirely sure I'm describing this correctly.

Look into the Nuclex framework: http://nuclexframework.codeplex.com/wikipage?title=Nuclex.UserInterface&referringTitle=Home Seems pretty decent.

GROVER CURES HOUSE
Aug 26, 2007

Go on...

Hanpan posted:

I've been trying to put together some kind of action based platformer for a while now, and I'm really stuck as to which engine I should use.

It started out as a flixel project, but Flash really can't handle the kind of things I want to do. After that, I tried out pygame and some of the libraries associated with 2d gaming. It's nice but I ran into the same performance problems I encountered with Flash. As the game progresses, I'm very keen to start using high res backgrounds so I definitely need an engine with a little more grunt.

I've tried Torque2d, which is terrible, as well as attempting to modify Unity which isn't really engineered with 2D games in mind (it's annoying having to model 3d objects for a simple platform.)

It seems to me the only real way to get the performance I want is to either build something for scratch. Does anyone know of any other engines out there I could try? XNA is probably right for what I need, but I'd like the game to be multi-platform if possible. I don't mind learning a new language if there is a particular framework out there which people can recommend.

Use XNA, it runs on two platforms and has MonoXNA under Linux/Mac. This also lets you use Silverlight, which is just :3:

Hanpan
Dec 5, 2004

Evil Trout posted:

Did you find that Flixel couldn't handle parallax scrolling? I'm using it for a small project and I have 4-5 layers of parallax at 60fps.

Depends on the size of your project and the complexity of your bitmapData. 2 layers were pushing it at 800x600.

seregrail7
Nov 3, 2006

Hanpan posted:

It seems to me the only real way to get the performance I want is to either build something for scratch. Does anyone know of any other engines out there I could try? XNA is probably right for what I need, but I'd like the game to be multi-platform if possible. I don't mind learning a new language if there is a particular framework out there which people can recommend.

I'm using XNA for a 2D action platformer and it's working out really well. I wrote my own engine for it, but I'm using Farseer for collisions and it's just awesome. Really simple to get something up and running and most of what I developed was done to make it even faster to implement new stuff. Performance is great for 2D games, not as good as other languages and APIs but for a 2D game you'd have to be writing some really bad code to run into any performance problems. My engine supports as many layers as you like moving at whatever speed you want. XNA is awesome.

Da Gaspodin
May 2, 2006

boxSpin(time);
I should probably post this here as well:

I started making a game with Processing yesterday as an experiment to what I could get done during a single weekend.
Well, Escapism is the result, and you can play it online at http://www.cs.uta.fi/~vp79799/escapism

It's a "combo-driven" jumpy-shootemup.

Only registered members can see post attachments!

FateFree
Nov 14, 2003

I'm looking for some guidance for a beginner project of mine. I've primarily developed web applications in Java, and I have a very good grasp of the language but I'm slowly realizing that I only enjoy the framework coding, and dealing with the front end of web apps is mind numbing.

So I want to start a long gaming project along the lines of a Dwarf Fortress kind of game. However its something I want to plan very long term, so I want to make sure I have a good foundation with the language, engine, and the works, so that in a few years time it might turn into something fun without having to scrap it and start over too many times.

I'm looking for advice on a good beginner book for game developing, what language or platform to consider for a long term 2D project (while I love Java, I want to work on a language more geared towards professional gaming), and any other starting advice.

I'm more afraid of starting down the wrong track and realizing three years later I should have gone in a completely different direction.

edit-more and more I am liking the XNA route, but have zero experience. Maybe I should ask what a good beginner book is for both game programming in general and using xna.

FateFree fucked around with this message at 17:52 on Feb 25, 2010

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."

FateFree posted:

I'm looking for some guidance for a beginner project of mine. I've primarily developed web applications in Java, and I have a very good grasp of the language but I'm slowly realizing that I only enjoy the framework coding, and dealing with the front end of web apps is mind numbing.

So I want to start a long gaming project along the lines of a Dwarf Fortress kind of game. However its something I want to plan very long term, so I want to make sure I have a good foundation with the language, engine, and the works, so that in a few years time it might turn into something fun without having to scrap it and start over too many times.

I'm looking for advice on a good beginner book for game developing, what language or platform to consider for a long term 2D project (while I love Java, I want to work on a language more geared towards professional gaming), and any other starting advice.

I'm more afraid of starting down the wrong track and realizing three years later I should have gone in a completely different direction.

edit-more and more I am liking the XNA route, but have zero experience. Maybe I should ask what a good beginner book is for both game programming in general and using xna.

I'm having a similar problem, wondering if I should go with Flash (easy to animate stuff) or C#/XNA (more familiar and easier to code, I find)

For learning languages, O'Reilly probably do a good book on it. I have a good C# game programming book I'll find the name for later, but the advice I got here was to learn the XNA element online rather than buy a book.

FateFree
Nov 14, 2003

Has anyone read the book Learning XNA 3.0 by Reed? The reviews look solid and I'm wondering if it would be a good start.

Bastard
Jul 13, 2001

We are each responsible for our own destiny.
Speaking of C#, there are some rumors going around (based on a video from a tech demo) that the next version of Torque2D will also be able to use C#.

I don't know how certain this is, but it sure sounds good. Torque Game Builder (the 2D variant of the Torque engine) is pretty cool to mess around in, but I could never quite enjoy Torquescript.

GROVER CURES HOUSE
Aug 26, 2007

Go on...

FateFree posted:

Has anyone read the book Learning XNA 3.0 by Reed? The reviews look solid and I'm wondering if it would be a good start.

It's a pretty good book, but nothing you wouldn't find on the Internet for free. Get it if you're not experienced with C#, otherwise hit the manpages and troll through already existing codebases.

seregrail7
Nov 3, 2006

Bastard posted:

Speaking of C#, there are some rumors going around (based on a video from a tech demo) that the next version of Torque2D will also be able to use C#.

I don't know how certain this is, but it sure sounds good. Torque Game Builder (the 2D variant of the Torque engine) is pretty cool to mess around in, but I could never quite enjoy Torquescript.

You can use a version of Torque2D with XNA, but you still have to work with the torque architecture, something I never got on with at all.

FateFree
Nov 14, 2003

Well I just gave XNA a try from zero game experience and I have to say, its really awesome. I built that stupid dvd idle menu with the floating logo within the first hour. Not bad and way more fun than web app programming.

My question is how much of a hassle will it be to get a game running on an xbox360? I know you have to join the creator club, but once I do can I get it running locally on my xbox fairly easily? I'd rather not submit it to the community or any of that, just sort of test it on the console.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

It's very easy. Basically you simply deploy it to the Xbox on your network, no need to submit anything to the community or anything.

Scaevolus
Apr 16, 2007

FateFree posted:

I'm looking for advice on a good beginner book for game developing, what language or platform to consider for a long term 2D project (while I love Java, I want to work on a language more geared towards professional gaming), and any other starting advice.

I don't think it really matters at the beginning. Your first few engines are going to be terrible while you learn how to structure things no matter which language you choose.

Nalin
Sep 29, 2007

Hair Elf

FateFree posted:

Well I just gave XNA a try from zero game experience and I have to say, its really awesome. I built that stupid dvd idle menu with the floating logo within the first hour. Not bad and way more fun than web app programming.

My question is how much of a hassle will it be to get a game running on an xbox360? I know you have to join the creator club, but once I do can I get it running locally on my xbox fairly easily? I'd rather not submit it to the community or any of that, just sort of test it on the console.
This tells you how to link up your XBox360 with your computer:
http://msdn.microsoft.com/en-us/library/bb975643.aspx

Once that is done, you either create a new XBox360 project, or create a copy of your existing Windows XNA project and have it target the XBox360 (you right click the project in the solution explorer and it is one of the options.) Then, there should be a Build/Deploy Solution link. When your XBox360 is running the XNA Game Studio Connect application, the Deploy link will deploy your game to the 360. You can then play it like any normal game. If you want to debug it, use the normal Debug option (when your XBox360 project is the active project) within XNA Game Studio Connect. It will deploy automatically and start a debugging instance.

Really, the only difficult part is getting it set up.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

FateFree posted:

Has anyone read the book Learning XNA 3.0 by Reed? The reviews look solid and I'm wondering if it would be a good start.
I have this one and think it's pretty good. The author's style can be annoying at times due to failed attempts at humor, but the substance is decent. It begins with an overview of XNA, then builds up a 2D game with increasing complexity, adds sounds with XACT, repeats it all for a 3D game, and finally does some HLSL and other bits. There are a few Zune/Xbox chapters that you can skip totally if you want.

I'd also suggest getting at least one book if you're just starting out. Following web examples can be educational and fun, but a short tutorial will never be able to give you a full sense of the XNA framework. Also a few web tutorial authors pull some hideous hacks off to get their example code up and running in the least amount of time and if you're just starting out you might pick up some really terrible habits.

FateFree
Nov 14, 2003

PDP-1 posted:

I have this one and think it's pretty good. The author's style can be annoying at times due to failed attempts at humor, but the substance is decent.

This is very true haha. But it was a good starter book, I learned alot and was able to deploy pong to the 360 no problem.

One thing that bugged me though, and agreeing with what you say, is that I could just tell the way he showed some of the code was really bad from an OO perspective, and for me that was really distracting. Good, encapsulated, reusable code is priority 1 in my book so my next question is:

Can anyone know recommend a book about good 2D or general game design best practices? I'd be really interested in knowing where responsibilities lie in terms of sprites and logic and game states and pretty much the architecture of a well designed game within the xna framework. Anything that comes to mind?

edit: anyone read Game Architecture and Design: Learn the Best Practices for Game Design and Programming (Andrew Rollings) ?

FateFree fucked around with this message at 23:28 on Feb 26, 2010

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

FateFree posted:

This is very true haha. But it was a good starter book, I learned alot and was able to deploy pong to the 360 no problem.

One thing that bugged me though, and agreeing with what you say, is that I could just tell the way he showed some of the code was really bad from an OO perspective, and for me that was really distracting. Good, encapsulated, reusable code is priority 1 in my book.
If you follow the code from chapter to chapter you'll see that he sometimes starts off with a not so great implementation at the beginning to keep things simple and then changes things to be a bit more OO style by the time the project is done. If I recall correctly he implements the first camera right inside the update/draw loops and then later moves it out to its own GameObject subclass.

FateFree posted:

Can anyone know recommend a book about good 2D or general game design best practices? I'd be really interested in knowing where responsibilities lie in terms of sprites and logic and game states and pretty much the architecture of a well designed game within the xna framework. Anything that comes to mind?
I've never dug into it, but Microsoft has a demo 2D game project for XNA here that might give you some ideas.

edit: A bunch more 2D stuff here too.

The_Frag_Man
Mar 26, 2005

Hey guys,

My engine is old and parts of it are hacks and the design sucks. What should I do?
Also I have a job and can't spend a lot of time on it.

I want to change pretty much everything but I don't know how to start.
Should I just start again?

Lurking Haro
Oct 27, 2009

The_Frag_Man posted:

Hey guys,

My engine is old and parts of it are hacks and the design sucks. What should I do?
Also I have a job and can't spend a lot of time on it.

I want to change pretty much everything but I don't know how to start.
Should I just start again?

How about planning it ahead and rewrite the parts of the old engine that aren't horrible mangled?
If you know what you need it's faster than programming as you go along.

The_Frag_Man
Mar 26, 2005

I was wondering if it's possible to go from mess -> good in small discrete steps.
I am pretty de-motivated right now. I will try and come up with a new design that will do what I want while aggressively cull things I don't need, and re-integrate the old components where possible into the new design. This makes sense. I think I will make a new project for this... but I'm not doing anything until I'm satisfied I have a hard plan to stick to.

I feel a bit better now.

Foiltha
Jun 12, 2008

The_Frag_Man posted:

Hey guys,

My engine is old and parts of it are hacks and the design sucks. What should I do?
Also I have a job and can't spend a lot of time on it.

I want to change pretty much everything but I don't know how to start.
Should I just start again?

Since you already have an engine, you probably have a pretty good vision of what components you want in it. Just do a new design upfront, but re-use what you have and use what you've learned from building this one. Got a decent class collection for collision detection but the public interface blows? Redesign the interface. Got a huge MegaStuffHandler class for handling too many different things that are in no way related to each other? Split it into smaller classes and aim for higher cohesion.

You say some parts of your engine are hacks and the design sucks. That means you must know what's wrong with it. What makes your engine suck? What makes parts of your engine "hacks"? Just write down what's wrong with what in the engine. If you can clearly identify these faults, you should be able to come up with a better design.

The_Frag_Man
Mar 26, 2005

Foiltha posted:

Since you already have an engine, you probably have a pretty good vision of what components you want in it. Just do a new design upfront, but re-use what you have and use what you've learned from building this one. Got a decent class collection for collision detection but the public interface blows? Redesign the interface. Got a huge MegaStuffHandler class for handling too many different things that are in no way related to each other? Split it into smaller classes and aim for higher cohesion.

You say some parts of your engine are hacks and the design sucks. That means you must know what's wrong with it. What makes your engine suck? What makes parts of your engine "hacks"? Just write down what's wrong with what in the engine. If you can clearly identify these faults, you should be able to come up with a better design.

Thanks pal. You are absolutely right.

stramit
Dec 9, 2004
Ask me about making games instead of gains.
Quaternion question:

I have written a 3d space controller. It is designed to handle rotation around all 3 axis and it works 'okay'. But there is a slight issue. If I rotate the mouse counter clockwise in a circle pattern a slight counter clockwise roll is induced in the controller and vice versa if I move the mouse in a clockwise motion. What I am doing is I believe quite standard, just multiplying the x,y,z rotation deltas into the existing transform. Can anyone explain to me why this would happen? I am relatively new to quaternions, but this seems correct conceptually to me. Have I got my multiplication order in the last step wrong? Or is the roll I am seeing just a property of quaternions. (Euler has gimbol lock quaternions have an odd roll?)

code:
	void Update ()
	{
		//Ignore input in ignore button is down
		if( Input.GetButton( "IgnoreControl" ) )
		{
			return;
		}
		// Read the mouse input axis
		Vector3 rotationDelta = new Vector3();
		Vector3 scaledSensitivity = rotationSensitivity * Time.deltaTime * 10.0f;
		rotationDelta.x += Input.GetAxis("Mouse X") * scaledSensitivity.x;
		rotationDelta.y += Input.GetAxis("Mouse Y") * scaledSensitivity.y;
		rotationDelta.z -= Input.GetAxis("Roll") * scaledSensitivity.z;
		
		//Create quaternions around x,y,z respectively
		Quaternion xQuaternion = Quaternion.AngleAxis (rotationDelta.x, Vector3.up);
		Quaternion yQuaternion = Quaternion.AngleAxis (rotationDelta.y, Vector3.left);
		Quaternion zQuaternion = Quaternion.AngleAxis (rotationDelta.z, Vector3.forward);
		
		//Rotate the localRotation by these new quaternions
		transform.localRotation = transform.localRotation * xQuaternion * yQuaternion * zQuaternion;
	}

haveblue
Aug 15, 2005



Toilet Rascal
What you're seeing is normal behavior. Each time you change the camera orientation, you're also changing the axes around which future orientation changes will be made. The effect adds up so that when you make that input you don't end up exactly back where you started.

stramit
Dec 9, 2004
Ask me about making games instead of gains.

haveblue posted:

What you're seeing is normal behavior. Each time you change the camera orientation, you're also changing the axes around which future orientation changes will be made. The effect adds up so that when you make that input you don't end up exactly back where you started.

I was hoping that wasn't the case and that I had made a mistake. Are their ways to minimize / remove this 'feature' of quaternions?

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
Try keeping track of rotationDelta, and setting transform.localRotation to just (xQuaternion * yQuaternion * zQuaternion).

brian
Sep 11, 2001
I obtained this title through beard tax.

If it's Unity (which it looks like it is), you can just use transform.Rotate() with euler angles and it'll automatically convert (easily fast enough) to quaternions and you won't suffer from gimbal lock or aggregating errors. I get horribly confused by quaternions though so it might not fit your purpose.

Fecotourist
Nov 1, 2008

brian posted:

If it's Unity (which it looks like it is), you can just use transform.Rotate() with euler angles and it'll automatically convert (easily fast enough) to quaternions and you won't suffer from gimbal lock or aggregating errors. I get horribly confused by quaternions though so it might not fit your purpose.

Can you elaborate at all on what it does, or do you have a link? All I find on the Unity website is on using the GUI tool. If transform.Rotate(EulerAngles) just encapsulates what Strumpy is already doing, it will have the same "problem". Which isn't due to accumulation of errors, but inherent in the spherical geometry of 3D rotations.

MasterSlowPoke posted:

Try keeping track of rotationDelta, and setting transform.localRotation to just (xQuaternion * yQuaternion * zQuaternion).
In other words, "use Euler angles"?

stramit
Dec 9, 2004
Ask me about making games instead of gains.

Fecotourist posted:

Can you elaborate at all on what it does, or do you have a link? All I find on the Unity website is on using the GUI tool. If transform.Rotate(EulerAngles) just encapsulates what Strumpy is already doing, it will have the same "problem". Which isn't due to accumulation of errors, but inherent in the spherical geometry of 3D rotations.

This is correct it will do what I am currently experiencing.

Docs are located here:
http://unity3d.com/support/documentation/ScriptReference/Quaternion.html

Thanks for the help guys, but it looks like I'm stuck between a rock and a hard place :(

FateFree
Nov 14, 2003

I've been messing around with the XNA game state management example to set up a basis for a sandbox game and I had a few questions.

Comin from java, I'm used to having projects broken up into general components, like a framework project, web project etc. It seems like the xna convention is to have three projects, a game project, data project, and processor project. Is this a standard of sorts?

And is it common to have additional projects that are more generalized? For example, I noticed the ScreenManager, GameScreen, and InputState classes from the screens example look very reusable. Should I maybe create a sort of framework project to hold common reusable components to my 2d game projects?

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Strumpy posted:

This is correct it will do what I am currently experiencing.

Docs are located here:
http://unity3d.com/support/documentation/ScriptReference/Quaternion.html

Thanks for the help guys, but it looks like I'm stuck between a rock and a hard place :(
Track the total rotation on each axis separately and apply them to a base value instead of the current rotation.

Adbot
ADBOT LOVES YOU

Fecotourist
Nov 1, 2008

OneEightHundred posted:

Track the total rotation on each axis separately and apply them to a base value instead of the current rotation.

If the axes are fixed, you get gimbal lock, don't you? And if they move with the current transform, you get Strumpy's problem.

Strumpy, if this is for your terrain viewer... Could you project the center of the planet into screen coordinates and use the (x,y) to get an angle theta. Construct and apply a quaternion that rotates around the camera axis by theta to put the center below the middle of the viewport. Of course you wouldn't compute the angle literally, just normalize them to sin and cos components. There's a gimbal lock-ish singularity if you look straight down, but it may be better than nothing.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply