What language is the ES collision engine written in?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Zunedude123
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Sun Feb 21, 2010 5:52 pm

What language is the ES collision engine written in?

Post by Zunedude123 »

What language was the Elysian Shadows collision engine written in? I know that many different languages are used in ES, but what was the collision engine made from?
User avatar
Lord Pingas
Chaos Rift Regular
Chaos Rift Regular
Posts: 178
Joined: Thu Dec 31, 2009 9:33 am
Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
Programming Language of Choice: C++
Location: Hiding In My Mum's Basement With My Pokemon Cards

Re: What language is the ES collision engine written in?

Post by Lord Pingas »

I'm pretty sure that most of the engine is written in C++ and a lot of it is written in lua.

Collision detection most likely written in C++.
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: What language is the ES collision engine written in?

Post by Live-Dimension »

While gyro can confirm it, LUA is hellish slow. I highly doubt that he'd write assembler for 3 different platforms, though it wouldnt surprise me. That is assuming you can even write assembler on DC/PSP. So that leaves c++. Lua would ask c++ to do collision checking with some kind of function. The core checking though would be done in pure c++ - lua is just too slow. c++ is more then fast enough for anything ES team can throw out when optimised for said platform.
Image
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: What language is the ES collision engine written in?

Post by avansc »

^

actually, depending on how many rigid bodies are simulated lua SHOULD be plenty fast enough to do something like that.

writing the entire collision in asm would be so marginally benificial most likely that it be better to write the core in C, and helper functions in asm. for the most part compilers are smart enough to make very good asm. i think he using bresenham in some of his calcs, and that would be a prime candidate to make in asm, its ver simple short, and there are plently little things you can do to make it faster.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
Trask
ES Beta Backer
ES Beta Backer
Posts: 738
Joined: Wed Oct 29, 2008 8:17 pm
Current Project: Building a 2D Engine
Favorite Gaming Platforms: Sega Genesis and Xbox 360
Programming Language of Choice: C/C++
Location: Pittsburgh, PA
Contact:

Re: What language is the ES collision engine written in?

Post by Trask »

avansc wrote:^

actually, depending on how many rigid bodies are simulated lua SHOULD be plenty fast enough to do something like that.

writing the entire collision in asm would be so marginally benificial most likely that it be better to write the core in C, and helper functions in asm. for the most part compilers are smart enough to make very good asm. i think he using bresenham in some of his calcs, and that would be a prime candidate to make in asm, its ver simple short, and there are plently little things you can do to make it faster.

Ow... Avansc's posts are too smart for me to read first thing in the morning.... UGH.

I do believe that everything related to that actual game engine is NOT written in lua in ES, I believe lua is simply calling functions from the engine, so the collision itself is still in the engine. Probably in C++ as I know Gyro wanted to optimize everything using C++, but as avansc said, there are benefits with writing it in pure C.
MarauderIIC wrote:You know those people that are like "CHECK IT OUT I just made Linux run on this piece of celery [or other random object]!!"? Yeah, that's Falco, but with ES.
Dear god, they actually ported ES to a piece of celery!
Martin Golding wrote: "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
User avatar
hurstshifter
ES Beta Backer
ES Beta Backer
Posts: 713
Joined: Mon Jun 08, 2009 8:33 pm
Favorite Gaming Platforms: SNES
Programming Language of Choice: C/++
Location: Boston, MA
Contact:

Re: What language is the ES collision engine written in?

Post by hurstshifter »

Zunedude123 wrote:I know that many different languages are used in ES
I'm fairly certain that the entire engine is written in C/++ while the game content is accomplished via Lua. So, the answer to your question will be C/++. I'll wait for an official response from Falco though.
"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: What language is the ES collision engine written in?

Post by Falco Girgis »

avansc wrote:^

actually, depending on how many rigid bodies are simulated lua SHOULD be plenty fast enough to do something like that.
Absolutely not. An interpreted language running on a 200mhz SH4 and 330mhz PSP? No.

At the moment, it's pretty ugly/optimized C. Lots of helper functions (as avansc said) are going to wind up being assembly on certain platforms. Collision in ES (well, Rigid Body collision) is NOT cheap at all. Not only does every entity have to be checked against every entity (until we get broad-phase implemented later), but lots of these entities are not axis aligned, and have to get thrown into the separating axis collision algorithm, then have their points of contact calculated, THEN have the physics engine calculate resolution values to be applied to each body.

Ontop of that, we're going to be doing some freaky shit to check Rigid Bodies against tile collisions. It's going to be relying heavily on Bresenham raycasting to determine potentially colliding tiles to be sent to the collision detector.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: What language is the ES collision engine written in?

Post by avansc »

GyroVorbis wrote:
avansc wrote:^

actually, depending on how many rigid bodies are simulated lua SHOULD be plenty fast enough to do something like that.
Absolutely not. An interpreted language running on a 200mhz SH4 and 330mhz PSP? No.

At the moment, it's pretty ugly/optimized C. Lots of helper functions (as avansc said) are going to wind up being assembly on certain platforms.
yeah in that case no, but i was thinking more along the lines of a PC, i keep forgetting this is actually a DC project at heart.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
Post Reply