Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Realtime Environment Destruction

This thread is locked; no one can reply to it. rss feed Print
Realtime Environment Destruction
Erin Maus
Member #7,537
July 2006
avatar

Hey, it's me again.

This time with realtime environment destruction.

Imagine you have a city... and you have an angry Gyrados or Godzilla or some other giant monster from a video game or movie series.

And that Zilla-like monster goes on a rampage. It shoots its Mega-death-beam. Buildings collapse. Yea. That kind of thing.

Well, I managed it in realtime. Here's a screeny:

{"name":"608360","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/e\/9e6c23b5243c92db1a6401f8766bf437.png","w":960,"h":540,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/e\/9e6c23b5243c92db1a6401f8766bf437"}608360

And another after I level the building:

{"name":"608361","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/d\/5d9a7aec2d665ae300ef0afc39d7c46e.png","w":960,"h":540,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/d\/5d9a7aec2d665ae300ef0afc39d7c46e"}608361

What do you think? Why not try it?

'1' shoots a beam where the mouse is. '2' shoots a beam as in the first screenshot. Left mouse button rotates, right zooms, and middle pans (when moving the mouse, of course).

Feedback appreciated!

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Your program opened a window with no content and then closed. Here is what the error.txt file said :

error.txt said:

System.NullReferenceException: Object reference not set to an instance of an object.
at CommaExcess.Hologine.Game.UnloadContent()
at CommaExcess.Algae.Application.Dispose()
at CommaExcess.Hologine.Program.Main()

Erin Maus
Member #7,537
July 2006
avatar

What graphics card do you have? Does it support OpenGL 3? If so, are the drivers up to date?

I'll have to enable some debug stuff later and you can try it again, if you want.

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

My laptop uses an integrated ATI Radeon X1270 graphics card on a Gateway M1617 laptop. I can't get updated drivers because gateway doesn't offer them and nvidia doesn't provide laptop drivers.

What version of OpenGL does my laptop support? I don't know, and the last time I tried to run that opengl version viewer program it just crashed hard.

Thomas Fjellstrom
Member #476
June 2000
avatar

I can't get updated drivers because gateway doesn't offer them and nvidia doesn't provide laptop drivers.

Sure they do. But nvidia drivers don't support radeon gpus. AMD also provides drivers for laptops, but the latest drivers may not support your older radeon. AMD likes to drop older hw rather quickly.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

jmasterx
Member #11,410
October 2009

Works on my pc. Really cool stuff!

Chris Katko
Member #1,881
January 2002
avatar

So it's Rampage in 3-D?

That being said, great implementation and good luck on your future work with it! I'm sure you can come up with some pretty cool story/plot ideas to take it from tech demo to true gaming experience.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I meant to say ATI, not Nvidia. And no, I can't use their drivers on this laptop. They have to be customized for it first by Gateway and Gateway is too lazy to offer updates on this laptop's graphics drivers anymore (at all to begin with).

Edit - OpenGl extension viewer says I only have OpenGL 2 installed. :/

pkrcel
Member #14,001
February 2012

Really REALLY nice, but on my system it ran quite sloppy at a 09-15 FPS range, was it expected?

Specs:

- MS Windows7 SP1 64bit
- Intel Core i3-2330M (on a laptop) processor @2.20GHz
- 4GB RAM
- Intel HD graphics 3000 integrated GPU

BTW is there some sort of procedura debris "formation"? Or are all the same? due to the sloppiness I couldn't quite see it right.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Erin Maus
Member #7,537
July 2006
avatar

Thanks everyone!

pkrcel, the debris is procedural. As far as the sloppy FPS, it's because I hadn't optimized it. I was making upwards of ~1000 small draw calls for the shards. Since I posted it, I've optimized it quite a bit, and now all the debris is drawn in one call. You can try this version, if you want, and see if you have significant FPS gains.

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

Chris Katko
Member #1,881
January 2002
avatar

What language are you programming it in?

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Vanneto
Member #8,643
May 2007

Judging from Edgar's crash report (and the spine-csharp.dll): C#.

Very nice, the second version runs much smoother than the first.

In capitalist America bank robs you.

Erin Maus
Member #7,537
July 2006
avatar

What language are you programming it in?

As Vanneto deduced, it's written in C#. I use a lightweight P/Invoke wrapper around Allegro 5 to create the display and handle input. Other than that, it's in C#.

The other bits and bobs include my graphics framework, which is based on modern graphics programming and is API agnostic (heck, I've adopted a few DirectXisms from working with XNA in the past). I don't support low level operations, just the basic "Here's a mesh, render it using this material to this render target."

Similarly, I use a custom game-engine-thing for the actual grunt of the non-graphics work. It's only for personal use, but it speeds up my game development quite a bit, when I can just pull code from other projects.

Vanneto, I'm glad to hear it runs better. I've made a few more changes since then. Just now, I finished optimized my loading code and get 60 FPS almost right off the bat during loading. Before, there was a flaw and loading would drop the FPS even in the loading screen... and thus cause delayed input, etc.

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

pkrcel
Member #14,001
February 2012

The new version runs SLIGHTLY smoother (~39FPS peak, 17PFS when all debris) but I also am on a different machine:

Specs:
- MS Windows 7-SP1 64 bit
- Intel Core i7-2670QM (a laptop...again :P )
- 4GB RAM
- NVIDIA Geforce 610M 2GB

I get a minimum of 12 FPSes with the integrated Intel HD3000 GPU, for the record...which is still a bit sloppy but more manageable than the previous 9 FPS.

ANYWAY I've seen that the debris are procedura but they seem cut out of the same shapes/volumes...well in any case it is really REALLY neat, props for this work.

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Go to: