Slick Forums

Discuss the Slick 2D Library
It is currently Tue Jun 18, 2013 5:18 am

All times are UTC




Post new topic Reply to topic  [ 170 posts ]  Go to page 1, 2, 3, 4, 5 ... 12  Next
Author Message
 Post subject: MarteEngine
PostPosted: Mon Sep 20, 2010 9:34 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
Marte Engine
Version: 0.2

1. Introduction

MarteEngine (ME) is a Java videogame engine with focus in a simple, clear API for fast game development.
Major inspiration comes from Flashpunk (http://flashpunk.net) and Slick forum (http://slick.javaunlimited.net/).


2. Contribute

MarteEngine is a opensource - MIT based (see license.txt) project hosted on GitHub: do want to try, improve or help?
With Git this is easy and fun :D

There are 3 main branch:

master branch: official content of engine, stable
dev branch: developer code, unstable and untested
dev tommy branch: Tommy's branch, developer code, unstable and untested



You can contribute also with ideas open a new discussion here: MarteEngine issues

3. Examples

We will add test in the future, you can fine into package test/it.randomtower.test and try it online with Webstart:

HelloWorld: most simple example, display something. Nothing to do or interact

Pong: need an introduction? Play pong with a friend. This example shows Worlds, Entity, collision and many important aspects of MarteEngine.

Tank: move your tank and kill stuff on screen, using your mouse and keyboard. This example show how to use entity rotation, mouse interaction and again collision.

Platform: jump around like Mario or Sonic! This example show how simple is build a platform

Tweens: test Tween capabilities of Marte Engine, moving around an entity and change Easing function like in Flashpunk

4. Documentation
You can find introduction, downloads and tutorials on github wiki.

Thanks to crazyandcoding, video tutorial, you can find them on crazyandcoding web site!

News:

25/2/2011: MarteEngine 0.2 is out! Check wiki for more information!

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Last edited by Gornova81 on Mon Jun 06, 2011 12:18 pm, edited 11 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2010 1:40 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
news: I've added StateMachine support, example here StateMachineExample.java

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2010 7:43 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
Nice stuff, Gornova!

Just playing around with git, which is a bit confusing right now.
I just wanted to get a "readonly" copy of your repository but I think I created a fork which is my own repository, right?
Is there a similar way to just checkout your stuff like in SVN or CVS? Or do I need to fork to get the sources on my machine and being able to update once in a while?

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 7:56 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
With git first operation in this case is "clone" from git repository (mine), so you can have all on your machine :D
From time to time, you can "commit" local changes to your pc-repo, and then "push" on your remote repository on github :D

Start from that, here I can see that you forked my repo (thanks!! :D ) but you don't push any of your local commit on github (here I can see only mine!). You can see MarteEngine family here, but on network page (from original MarteEngine point of view) I cannot see nothing just because you need to push something on github :D just try it :D

You can find a good guide here for git from svn perspective :D

Just to share my thoughts :D
I don't want to have a Flashpunk port on top of Slick, instead some good ideas and practice from FP world to Slick world :D
But feel free to play with it, and share (push) your code so I can see it :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 9:05 am 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Looks awesome Gornova! Totally approachable as a project too. Would be great to see the full engine on top. As and when it's ready to play with could you let me know, I'd like to write some tooling on top to allow visual creation of games (something I've been trying to find time to do for years!)

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 9:40 am 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
Thanks, Gornova!

I think I will delete my fork then and go for a clone.

Right now I just copied stuff that I needed into my project. Before committing I would prefer to discuss issues first :wink:

For example as I already mentioned I would love to use ME in a state based game environment. This makes it necessary to modify ME from being a static container "for everything" to some instance oriented thing.
Meaning each GameState instance has its own ME instance.
If you pass the appropriate ME instance into each entity the code changes should be minimal.

Another thing is the way of dealing with commands inside of Entities. I think this is not the best design.
Imagine two game states, intro and main game. In intro you want to show the player sprite running around just for the fun of it. But because the command handling is dealt with inside Entity and so inside the Player code you cannot forbid user input on the intro screen...
So I would move the command handling stuff out of Entity and maybe move it into the ME class or even completely drop it and put it into the update method of the GameState subclass.

I will fiddle around with your code and come back to you :lol:

Cheers,
Tommy

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 10:40 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
kevglass wrote:
Looks awesome Gornova! Totally approachable as a project too. Would be great to see the full engine on top. As and when it's ready to play with could you let me know, I'd like to write some tooling on top to allow visual creation of games (something I've been trying to find time to do for years!)

Kev


really cool idea :D maybe something like Slick Webstart Marte Engine Games Maker :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 12:19 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
Tommy wrote:
Thanks, Gornova!

I think I will delete my fork then and go for a clone.

Right now I just copied stuff that I needed into my project. Before committing I would prefer to discuss issues first :wink:


There are many issues :D But if you want I'd like to discuss here!!

For now:
1) Entityis a good piece of code IMHO :D You can:place it on screen easily, render and update it. But... but is not perfect, I was developing a little rpg example for MarteEngine (here MoveAvatarTest) , it's working and you can add keybinding to actions movements, animations and so on.. but all code is too complicated and an Entity must be more general, I need to put some effort in it, I know :D
My idea is not to build a component based entity system, but instead build a little library to help in developing simple games. Put thing on screen, move it, and then play more with Slick, java and gameplay elements :D For example, what do you think of this TopDownActor?

2) must I add World concept from FP to MarteEngine? Worlds are some sort of box for anything related to a level/menu on screen, something like rooms of GM. Ideally could be interesting, but there are issues with Slick. For my point of view Worlds = State for a state based game, but without useful stuff around it: d

3) work hard to put collision stuff on a good level: need some testing with it, for now only shape (aka Rectangle) collision is in MarteEngine, but could be cool to put some sort of pixel perfect collision? We can use FP ideas :D

4) write demos! For now I have only HelloWorld, Pong and MoveAvatarTest, but what I want in perspective is a little platformer and an rpg :D Demos is useful to test MarteEngine and find new and useful features

5) debug features: if you set a debug key, MarteEngine show you some veeery basic information about your game: collision boxes :D This kind of thing is really useful (you), but what about a little console? Maybe with scripting capabilities ? This could be awesome :D

6) Alarm :D One extremely useful stuff of FP are Alarms, add it to a game, MarteEngine handle it, and then call callback, so developer don't need to work with elapsed time and so on :D

7) Package organization :D I will follow maven structure (but for now ME is not a maven project), just to have more clean organization in this project

8) I'm thinking also on a small gui integration, maybe with TWL, I don't know: most games don't need very sophisticated guis, but a basic message system :D

Tommy wrote:

For example as I already mentioned I would love to use ME in a state based game environment. This makes it necessary to modify ME from being a static container "for everything" to some instance oriented thing.
Meaning each GameState instance has its own ME instance.
If you pass the appropriate ME instance into each entity the code changes should be minimal.


State and StateManager are something really useful, but I need to think about it. How much games need it? How to support State on a general Entity of MarteEngine without force too much stuff? How to support your idea? Maybe what do you have in mind is a sort of FP World approach: have different "World" (aka states, with entities, alarms, etc..) and one FP static class with one current world rendered/updated and capability to switch between them --> as I written before, this is a replacememt for Slick-based approach? I don't want to confuse anyone, in particular me :D

Tommy wrote:
Another thing is the way of dealing with commands inside of Entities. I think this is not the best design.
Imagine two game states, intro and main game. In intro you want to show the player sprite running around just for the fun of it. But because the command handling is dealt with inside Entity and so inside the Player code you cannot forbid user input on the intro screen...
So I would move the command handling stuff out of Entity and maybe move it into the ME class or even completely drop it and put it into the update method of the GameState subclass.

I will fiddle around with your code and come back to you :lol:

Cheers,
Tommy


After read this comment I think that we need World approach :D So you can define one World with menu stuff and another one World with Game stuff (in particular Player Entity with commands), what do you think?

I'm writing a lot today :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 1:12 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
Gornova81 wrote:
1) Entityis a good piece of code IMHO :D

Agreed. Entities have a lot of convenience stuff already builtin and are good to work with!
Quote:
.. but all code is too complicated and an Entity must be more general, I need to put some effort in it, I know :D

I think the Entity code itself is complicated - at least the update and render routines which need to deal with a lot of stuff.
Quote:
My idea is not to build a component based entity system, but instead build a little library to help in developing simple games.

Good approach, IMHO. You could follow the Game Maker path regarding entities: just add the possibility to plug in additional functionality.
For example your Entity or ME update and render routines could already call a lot of empty methods that you can override in your own Entity subclasses (onCreate, onCollision, onTimer, onMouseClick, onKeyPress, you'll get the point). That would make Entity class even more complex but no engine user would deal with Entity directly but only assume it's working as expected and subclass it and add required functionality by overriding certain methods...

Quote:
For example, what do you think of this TopDownActor?

That's a nice example entity to get people started, right!

Quote:
2) must I add World concept from FP to MarteEngine? Worlds are some sort of box for anything related to a level/menu on screen, something like rooms of GM. Ideally could be interesting, but there are issues with Slick. For my point of view Worlds = State for a state based game, but without useful stuff around it: d

Tough question. Two possible solutions:
a) add a world concept
b) enhance the existing GameState classes of Slick by providing a subclass (call it World if you want) of GameState class with your additional features.

I would definitely prefer b) because then you can keep much of Slick's builtin stuff (like GameState transitions, proper call of init/update/render) and add your stuff too.
Quote:
3) work hard to put collision stuff on a good level: need some testing with it, for now only shape (aka Rectangle) collision is in MarteEngine, but could be cool to put some sort of pixel perfect collision? We can use FP ideas :D

I'm not sure anymore if pixel perfect collision is required. Depends on how difficult it would be to add and what it would cost performance wise. But any Slick Shape should be usable as a collision boundary.
Quote:
4) write demos! For now I have only HelloWorld, Pong and MoveAvatarTest, but what I want in perspective is a little platformer and an rpg :D Demos is useful to test MarteEngine and find new and useful features

Yes! But you need to clean up the repo a bit, right now engine classes and sample classes are mixed in the src directory tree...
Quote:
5) debug features

Later.
Quote:
6) Alarm :D One extremely useful stuff of FP are Alarms, add it to a game, MarteEngine handle it, and then call callback, so developer don't need to work with elapsed time and so on :D

Yeah, nice feature (also borrowed from Game Maker). Shouldn't be too complicated to implement. Doesn't Slick already have a Timer class?
Quote:
7) Package organization :D I will follow maven structure (but for now ME is not a maven project), just to have more clean organization in this project

Later. A jar should be fine for the beginning :wink:

Quote:
State and StateManager are something really useful, but I need to think about it. ...
I don't want to confuse anyone, in particular me :D

Already gotcha! I was not referring to your new State and StateManager stuff in Marte, but I meant the Slick GameState classes as already mentioned above under 2).

Quote:
After read this comment I think that we need World approach :D So you can define one World with menu stuff and another one World with Game stuff (in particular Player Entity with commands), what do you think?

Yes. Again as written under 2). And I still think (after typing a lot) that the approach of subclassing Slicks GameState to implement World stuff is the best solution.
Quote:
I'm writing a lot today :D

Me too :lol:

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 2:09 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
While thinking about it:

If you create something like a World class and make that subclass of Slick's GameState class then the new World class could also implement all the stuff that's currently in your ME class, like updating and rendering all the entities and handling collision and input stuff!!! This way it would already look much more like FP's World class or Game Maker's Room concept.

Right now this idea looks promising to me :D

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 2:44 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
I will work on World extends Slick State concept, maybe in another branch :D

Roadmap for me:
1) clean up entity code
2) add World class that extends Slick State
3) move all demo stuff out of src

thanks for feedback, feel I'm not wasting my time. What other ideas do you have from your project/games?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2010 3:17 pm 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
Gornova81 wrote:
thanks for feedback, feel I'm not wasting my time


No, not at all :D
I'm loving Game Maker's ideas and the way FlashPunk moved those to Flash and the browser world.

But still Java is my favorite language and having hardware accelerated OpenGL and this as Webstart, Applet or stand alone with Slick is just great and IMHO better and faster and more powerful than Flash!

Now add your Marte Engine on top of it to get the easy approach of Game Maker's concepts to the Slick world and (at least) I'm sold and happy :lol:

Regarding ideas: There are so many convenience methods/functions in Game Maker which could be added to Entity like:

- angle and distance to other entity,
- setting angle and speed and off you (entity) go,
- horizontal and vertical screen wrapping for entities,
- callback when entity leaves the screen,
- multiple views into the same world (for hot seat games or minimaps),
- resetting an entity to it's start position (I already added that for me),
- change one entity into another (jumping frog entity transforms into dead frog entity where common attributes like position are copied),
- storing of previous position to jump back on collision,
- init code that is executed on entity creation (for starting a timer/alarm for example),
- moving two entities next to each other without collision (say your player entity collides with a platform. In the collision method of the player you move the player with one method call to be exactly on the border of the platform but not colliding with it).

Shall I continue? :lol:

You see, tons of ideas that could go into your engine.

Let me get this Git clone thing working and I'm aboard :wink:

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 19, 2010 2:56 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
Update:

After branching codebase on dev branch (see first post), I'm managing some big changes (and some classes moved from src package to test, and a little of organization about it :D ).
First is World, like in Flashpunk you can have many states in your game (Intro, Game, etc..). Developer can found in MarteEngine quick and easy way to add to main game new state using World class, that will handle all stuff about render and update your entities.

Credits need to go to Tommy :D

I need more and more test on dev branch before merge on master, but for now (simple Pong example), create pong is easy:

1) make PongTest class extends slick's StateBaseGame
2) add to your game both PongIntroState and PongGameState, both extending World
3) draw some instruction about Pong into PongIntroState
4) add Entity on PongGameState: ball, two players and borders

Pong example done :D

Is a simple example, with a bit of more code than before, but now you can see better separation between states (Intro and Game).

I've decided for now to keep ME class, just to have in one place all static stuff and I'll extend it with more feature (and more general) :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 02, 2010 10:26 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1317
Location: Italy
thanks to Tommy, I've integrated StarCleanersource code into MarteEngine, as example :D

There are many changes (good changes!), see GitHub repository :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 09, 2010 8:38 am 
Offline
Regular

Joined: Sun Oct 25, 2009 5:24 pm
Posts: 118
I really like your engine and me and my team are currently working on a platformer for a work project.

One thing I missed was the ability to set a "dead zone" to the camera, like a border. So when the Y positon (for example) changes below this border, the camera stops following the player, like when you fall down a hole or a gap (think of Mario) :)

I've added this feature since it's basically just another attribute, I could post a patch if you'd like to git, but I'll have to do it from home since I cant access the HTTPs from work.

Keep up the good work :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 170 posts ]  Go to page 1, 2, 3, 4, 5 ... 12  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group