Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Small Engine

Author
Message
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 2nd Mar 2011 02:45 Edited at: 11th Jun 2011 17:54
MOST RECENT VIDEO


Hey TGC.
So as it would turn out, Im working on an 'engine' of sorts. Its more like a collection of tools that I can pull from at a later date, but I figure that fits a loose definition of the word. I am not using any TGC products, and as such, I cant post on the WIP board, which makes my little heart sad inside. I want to share what I have so far, and I thought that maybe I could post to the geek culture board. I thought about game design, but I didnt think it would fit.

All of the stuff I'll post, has been been posted somewhere at somepoint on the forum (for now). But instead of bringing old threads back to life, I decided to devote one thread to it.

Other than wanting to share my work with you guys, I wanted to get some feed back on what Ive been doing so far. Let me know what you think, and what kind of features you think a good engine should have.

So far, I have a simple physics simulation.


And I have a basic 2D drawing system up and running


Im hoping to make this big. The current plan is to get in some sort of scripting system, music functions, better the stuff I have done, and then work from that to make a test game. What kinds of features am I missing?

Edit:
I have a sort of website with more information.
http://smallgroupproductions.com/news

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 2nd Mar 2011 08:13
Really cool. site bookmarked.

You might wanna use a different method for motion blur though. It's kinda... blocky, in its current state.

Also, if not TGC products, then what libraries are you using?

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 14th Mar 2011 04:48 Edited at: 14th Mar 2011 12:36
Thanks Neuro Fuzzy

Im using XNA as my frame work, and other than that, Im on my own.

My audio buddy and I are working closely to develop a nice audio system. The idea is to raise and lower different effects in different instruments to get all sorts of different feels with only one track. The test results are in and the results are fantastic. The attached mp3 is a long recording of me messing around with the ingame music effects.

I have to admit, I had a hard time just ripping the audio and I am ashamed to say the recording was me holding up a microphone to my speakers.

Attachments

Login to view attachments
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 16th Mar 2011 23:53 Edited at: 16th Mar 2011 23:53
I am writing a showcase demo that should give a good idea of how easy it will be to switch the mood of a scene. Here is a screenshot.


Attachments

Login to view attachments
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 17th Mar 2011 21:56 Edited at: 17th Mar 2011 21:56
Here is a video update of that screen shot.


Image All
19
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 17th Mar 2011 22:08 Edited at: 17th Mar 2011 22:08
about the latest video: "this video is private"

about the second video: the motion blur effect isn't motion blue at all, btw. real motion blur is taking the average color of however many frames you want to blur; it's like temporal anti-aliasing. so instead of just fading out what was there before, you actually render (let's say) 5 frames, and the end-result of the motion blur is rendered by drawing pixels of the average color of all 5 frames.

other than that, looks good, hoping to see some kind of platformer emerge here

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 17th Mar 2011 22:12
Ooooh, thanks for the tip about motion blur, I was wondering how to make it better, because the way its "accomplished" right now is pretty hunky n' chunky. The video is public now, I thought I had switched it, but I guess not

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 1st Apr 2011 13:47 Edited at: 1st Apr 2011 13:47
Here is a video of a somewhat overhauled physics system. It still has bugs, but its getting better.



TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Apr 2011 17:47
Reminds me a lot of Break Quest, nice job!

TheComet

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 2nd Apr 2011 01:11
Thank you.

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 2nd Apr 2011 03:45
flashing snall, that ambient video is amazing!

So... Is XNA good? The licensing is royalty free for PC games right?

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 2nd Apr 2011 06:59
I like XNA a lot, but I dont like all the hullabulu one has to go through to get a project onto the Xbox. For PC I think its royalty free, yea.

My plan is to get a demo of my team's project from DreamBuildPlay, and also submit that demo to Steam and see if I cant work out a deal.

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 9th Apr 2011 07:35 Edited at: 9th Apr 2011 07:35
The team and I have decided to have a playable engine tech demo by this upcoming friday, April the 15th. It should support the drawing tech, physics, multiple players with shooting and that jazz, the music, and a basic debug/menu system. Oh, and the camera features too.
Here is a test shot to see if the team likes the map I put together real quick.



Attachments

Login to view attachments
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 15th Apr 2011 13:47 Edited at: 15th Apr 2011 13:48
So today is demo test day and as such I have a nice little packed up demo file for the team to play. A video will surface due to this, but for now (for the few who are interested), this is what the demo looks like

In the demo, you can get up to 4 players zooming around the physics playground. You can shoot at eachother and knock things around. When a player is hit by a bullet, the game goes into a slow motion which lowers the physics time increment and vaults down the pitch / frequency on the audio. This is being played on the xbox.

Attachments

Login to view attachments
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 24th Apr 2011 19:31
My buddy and team mate coder pal has been working on some particle code. We want 2 types of particle systems. An animated sprite based one that just plays a sprite at a point. TGC has a good piece of software for generating the sprites.
The other is a dynamic particle system. The main function we want it to serve is this. The particles will form shapes on the map, like words or symbols. Then the player can wizz through them or shoot them and the shapes of particles will dissapate and explode. Over time however, they will move back to their original positions so that they re-create the shape they began in.

He made a quick video demo.


flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 1st Jun 2011 09:27
I post because it makes me feel better, not because people are interested in what I have to say
End of school exams halted us for awhile, but summer is officially under way (NO MORE HIGH SCHOOL!) and so we are back to crankin' out work. The first order of business is to optimize our Shape and Physics systems because as of now, they can only handle about 40 objects on the Xbox360 (which is sad). The Xbox has nice hardware, but its memory management is a pain in the bum to work with, and we didnt realize that. After a few days of work, our number of Shapes W/out physics response went from 45 -> 180. The physics response shouldnt lower that number too much at all. The major performance killer is the fact that we want to check every shape with every other shape. So 2 shapes means 4 checks. 4 shapes means 16 checks. 10 shapes means 100 checks. It gets out of control quickly.

But now its super later and there are picnics and end-of-year fun to be had in the mornang, so I big TGC a good night.

*sniff sniff, I love you guys*

Dark Frager
15
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 1st Jun 2011 18:57
Cool, this is coming along really well...

But, are you gonna make the next Half-Life?

You can call me Adam.

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 1st Jun 2011 23:22
Hehe, the next half life is half life 2, and Valve beat me to it. No, we arnt shooting for the moon here, we just want a respectable amount of objects active at once.

Dark Frager
15
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 2nd Jun 2011 00:19
Have you tried working on a menu system? That would be cool.

Quote: "Valve beat me to it."


Damn you valve!

You can call me Adam.

crispex
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location:
Posted: 2nd Jun 2011 02:34
This is looking really great, nice work.

I just now realized I've had a typo in my signature for the past 3 years.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Jun 2011 05:09 Edited at: 2nd Jun 2011 05:10
Just popped in and saw your progress. It's looking good so far! I like the physics!

Quote: "The major performance killer is the fact that we want to check every shape with every other shape. So 2 shapes means 4 checks. 4 shapes means 16 checks. 10 shapes means 100 checks. It gets out of control quickly."


Yeah, that sounds like it definitely needs some work. Have you thought about performing quick distance checks (non-root checks) between objects before actually running intensive physics calculations between them? A simple a^2+b^2=c^2 check before a physics run on 2 objects shouldn't bog things down, and the amount of skips could save a lot of frames. If you're already doing that, just ignore me.

Keep up the great work! Your team's doing wonderful so far


~Plystire

Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 2nd Jun 2011 07:54
@Plystire
I've thought about that a lot actually, but I dont think it would actually save much time. But maybe it would I should test it out and see if it helps. The collision detection is more costly than the collision response (aka physics). I put in a Bounding Box check before it goes into the collision detections (which is the SAT http://www.metanetsoftware.com/technique/tutorialA.html).It didnt really help much, because it is only eliminating ONE check. The key is to eliminate the entire nested loop.

Looping through them looks like this

Doing a distance check would stop the collision, but not much more. The bounding Box check didnt really help, but if the distance is quicker, that might be better.


Well thats that.


The big issues with the physics engine are multi-body events. When one body is struck by 2+ bodies at once, I am having a hard time handling the event. But I had a long talk with a brohah, and I think we have a solution worked out.

Thanks for all the wonderful comments They make my heart swell up inside.

BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 2nd Jun 2011 09:30 Edited at: 2nd Jun 2011 09:33
Quote: "The major performance killer is the fact that we want to check every shape with every other shape. So 2 shapes means 4 checks. 4 shapes means 16 checks. 10 shapes means 100 checks. It gets out of control quickly"


You should use Quad Trees to check which shapes are in a particular region. Then you only need to check collisions against those shapes in that region. (Divide and Conquer and all that jazz)

Engine looks good though!

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 6th Jun 2011 02:23

I made some progress with physics. This is actually huge progress. Before, these kinds of collision systems would result in a lot of overlapping, and that would cause the system to explode.

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 6th Jun 2011 07:51
Here's a tip: have a grid essentially overlayed on your entire screen. (a 2d array is all I'm saying). Have each element in the array be a dynamic/resizable array of pointers to objects. Then, work out some mechanism so that every time you update your physics, each object's pointer will be added to every grid element that has at least a point belonging to the object. Then, FOR every grid element that the object belongs to, check collision with all the objects that also have points in that grid element.

So first I'd have a function that gets a grid position from a world position (lets say gridpos(x,y)). Then I'd take the largest radius on an object (yknow, from its center to a given vertex), and in a box from gridpos(posx-lradius,posy-lradius) to gridpos(posx+lradius,posy+lradius), add a handle to the object in all the grid array elements. Then, after that's done for all objects, I'd check those same grids again, and handle collision with all the objects that have points in those grid elements.

I hope you followed that, I'm not great at explaining things sometimes xD

Estimating how many calculations that'd be:


(number_of_objects)*(average radius in grid units)^2 additions to dynamic arrays
aaand everything else seems hard to calculate. you'd also have to either deallocate the arrays each frame, or use some fancy mechanism for adding/removing objects from the griids.


Tell me if there's a broken link to images in a thread I post, and I'll fix 'em.
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 7th Jun 2011 05:52
Thats a good idea, Fuzzy, and Ive spent all day working on it. I used arrayLists to make it easy, and the performance went up, so I think Im going to now try and convert them to straight up arrays to improve performance again.

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 11th Jun 2011 17:53
I added in spring support for the rigid bodies. Its not completely finished yet. At the moment there is a Spring Class with pointers to two bodies, and when the spring.update() method is called, it gives forces to the two bodies depending on whats going on. It works well, but I think there is room for improvement. Check out this video...


Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Jun 2011 03:26
How well do the springs work other physics bodies?

Also, can you specify rigidity of the spring? So you can have springs of varying strength.


Lookin' good


~Plystire

Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 14th Jun 2011 08:48 Edited at: 14th Jun 2011 08:50
The force of a spring, F, is F = k(x-d). k is the "rigidness", or spring contant. Because its multiplying the (x-d) term, the higher k is, the larger the spring force is going to be. x is the equilibrium point in the spring, or the default length that the spring always wants to return to, and d is the current length. So if k = 1, and x is 5, but d is 10, then
1(5-10) = 1(-5) = -5 = Fs.
There is a -5 Newton force acting on both bodies attached to the ends of the spring. Technically, it should be 5/2, because the force in the spring is being split between two bodies, but I dont really care, because it doesnt totally matter.

So when the sprint.update() method is called, Fs is calculated, and then applied to each body attached to the spring.
Next, when the body.update() method is called, it looks at the sum of all forces (which is most cases is just the spring force), and then using F = ma, gets an acceleration, which then steps down to a new velocity, and from there a new position Vector.

Other bodies can hit and smash into the bodies attached to the spring, and it will respond correctly. I have it set currently so that the bodies on a chain of springs wont collide with eachother, it just makes it less prone to crashes.


The other thing about the strength of the spring is the friction force on the bodies on either ends of the spring. If there is no friction force, then the spring will continue to move forever. When a friction force is added in, which adds itself into the sum of forces, and opposes the directino of velocity with a dependences on the magnitude of the velocity, that also determines how "strong" the spring is. If there is a high friction force, then it is "stronger"




Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 14th Jun 2011 10:31
Yes, I know the physics equations, I was just asking if you were able to set "k" for each spring created in your engine.


~Plystire

Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 14th Jun 2011 15:29 Edited at: 14th Jun 2011 16:00
Educational for me nonetheless.

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 14th Jun 2011 15:58
Yes, I can set 'k' to whatever I like.

My buddy who is working on the particles made the switch last night to use HSLS to render and keep track of the particles instead of just regular C#. This is awesome, because it allows for more particles at once, and cooler effects, and he now knows shader language

flashing snall
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 6th Jul 2011 08:45 Edited at: 6th Jul 2011 08:46
Ive been awhile for awhile, mostly because I went away for a mission trip, and then I took a spin with building some stuff with balsa wood, which is loads of fun. But I visited my project here, and made a couple steps forward I think.

The first one is that before I was using an Euler integrator system, and now I have switched over to an RK4 integrator, which gives better results. For an article on what the heck the difference is, check here
http://gafferongames.com/game-physics/integration-basics/

The second thing I did was start writing a quadtree system. I had been using a grid system to prevent every object from checking collision with every other object, but I wanted to see if the quadtree approach would work better. I have a basic system up and running where I can get the quad that a test point will lay in. I was able to run a point check about 4000 times per frame without a performance drop. Each shape usually has 4 corners, so thats 4 point checks per object, which means about 1000 objects before collision detection / response is added in. Im liking those numbers so far. Although, Im sure that when I deploy on the xbox, they will drop like a rock.



Attachments

Login to view attachments
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 6th Jul 2011 13:56
@flashing snall
Box2D is open source so if you ever get stuck on the physics I suggest you take a look. I've learnt loads just from wrapping it for dbpro.

[b]

Login to post a reply

Server time is: 2025-05-21 06:31:47
Your offset time is: 2025-05-21 06:31:47