March 29, 2024, 09:41:45 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 [2] 3 4 ... 77

Author Topic: Official PyGG2 Development thread  (Read 137670 times)

Maxaxle

  • Full Member
  • ***
  • Karma: -128
  • Offline Offline
  • Posts: 398
  • Resident Serious Business
    • My Site
Re: Porting GG2 to another Language - New Thread
« Reply #15 on: August 26, 2011, 11:07:24 pm »

Thanks for explaining that. But I'm curious: is anyone considering a different physics engine, and what happened to JGang (or was that just a test)?
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to another Language - New Thread
« Reply #16 on: August 26, 2011, 11:41:22 pm »

Hm well no it doesn't quite like that

C++ is a compiled language. Game Maker isn't as much a full programming language as it is just a scripting interface with which is interpretted on the fly without any optimizations.

Java is somewhere in between. Java compiles down to what's known as "byte code." Byte code isn't pure machine code like a compiler would do on C++, but it's still compiled nonetheless at a level which is higher than machine level, but still mechanically optimized for speed and efficiency. This bytecode is then executed on the fly similar to Game Maker, but it works much faster in edition to being a much more robust programming language. What matters here is that the bytecode from java can then be executed on the Operating System it's running on, which makes it extremely portable as no matter the platform you're compiling it from, it will still compile to the same code, as opposed to C++ which is comparably less portable depending on what compiler you use. Java will not execute as fast as any code that's optimized in C++, C, or even more low level like assembly by design, but nowadays java's nearly as fast as it nonetheless.

Of course there needs to be a client or "runner" if you will to interpret that code. Java's as Sani's said widely adopted, which is why you can even run it from your browser. Game Maker, being created by pretty much one person, lacks that sort of open-ended portability. Game Maker, although quite a deal faster now that it's engine has been moved from delphi to C++, is still very flawed and is no where near as fast as java or most other languages for that manner.
« Last Edit: August 26, 2011, 11:43:51 pm by NAGN »
Logged

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12206
Re: Porting GG2 to another Language - New Thread
« Reply #17 on: August 26, 2011, 11:43:12 pm »

thank you nagn I was half baiting a post from you
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

Maxaxle

  • Full Member
  • ***
  • Karma: -128
  • Offline Offline
  • Posts: 398
  • Resident Serious Business
    • My Site
Re: Porting GG2 to another Language - New Thread
« Reply #18 on: August 26, 2011, 11:44:21 pm »

Quote from: NAGN
run it from your browser
Sexy.

But what about the somewhat-separate physics engine? Any news about that?
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #19 on: August 26, 2011, 11:50:36 pm »

physics engine? Beside collision, a 2d plat former doesn't really need physics. A game engine, perhaps.
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to another Language - New Thread
« Reply #20 on: August 26, 2011, 11:53:32 pm »

Jgang was shelved for a bit as MedO needs to work on college. It's mroeso been abandoned for the time being, but medo's been working hard on the game.



as for the physics, Jgang used JBox2d. Box2d is a very powerful and very very good collision and physics engine which is very widespread. You can find it on a variety of platforms, even on the iphone, and on a multitude of programming languages. One very good example would be AngryBirds.

When I say alot, I mean alot, iphones,mac, linux, PCs, Xboxes and all sorts have a box2d port somewhere along their lines, you can even use the library with flash, which is very commonly used for a bunch of physics based video games on it.

Here's a demo:

http://www.box2dflash.org/

Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #21 on: August 27, 2011, 12:21:20 am »

Hm, I played with that demo a bit. It doesn't seem to handle collisions with angled objects; stuff slides around rather then rotating where appropriate.

Of course, not that I could do better, but...
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to another Language - New Thread
« Reply #22 on: August 27, 2011, 12:22:54 am »

it's not the best example ever, per say it's just the easiest I could find, I'm pretty sure that it's just a replicent of the example projects which came with the distribution of the Box2d C++ library but in flash
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #23 on: August 27, 2011, 12:25:29 am »

Yeah, regardless that's pretty cool to have been done in flash. I'm not even sure how that could even be implemented in flash with such complicated collision detection
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to another Language - New Thread
« Reply #24 on: August 27, 2011, 12:27:12 am »

the box2d libraries were designed to be very flexible and portable
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #25 on: August 27, 2011, 12:30:19 am »

Actually, I should go study up on how collision detection works, seems complicated.

Edit:
Lol, jk, this shit's simple.
« Last Edit: August 27, 2011, 12:31:37 am by Vindicator »
Logged

NAGN

  • Developer
  • ******
  • Karma: 146
  • Offline Offline
  • Posts: 16150
  • Yeah so now I have an idea
Re: Porting GG2 to another Language - New Thread
« Reply #26 on: August 27, 2011, 12:31:35 am »

Yeah, personally I'd rather leave it to the engine to deal with all the collisions personally, but that's mostly because I've yet to even LEARN about the basics of intertia, mass, or even trigonometry
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #27 on: August 27, 2011, 12:33:01 am »

I just looked it up, it's not difficult at all, it's just a system of equations for each face of the polygon:

You take the face of a polygon and find a perpendicular axis, and compare it to each face of the next polygon. If none intersect, then you have your answer.

http://www.codeproject.com/KB/GDI-plus/PolygonCollision.aspx
« Last Edit: August 27, 2011, 12:33:14 am by Vindicator »
Logged

Vindicator

  • Developer
  • ******
  • Karma: 84
  • Offline Offline
  • Posts: 2398
    • http://www.kylemoy.org/
Re: Porting GG2 to another Language - New Thread
« Reply #28 on: August 27, 2011, 12:34:58 am »

Unfortunately for us, the only non-box collision mask in GG2 is the walkmask, which isn't a polygon (atleast not defined by a set of points), so this is all useless.
Logged

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 10312
  • Dust in a box under a table
Re: Porting GG2 to another Language - New Thread
« Reply #29 on: August 27, 2011, 12:35:00 am »

The only, and this is flimsy at best, thing I don't like about this, is less 'friendly' modding
Pages: 1 [2] 3 4 ... 77
 

Page created in 0.025 seconds with 35 queries.