Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  using beans for my game editor, good idea? comments wanted :)  (Read 1298 times)
0 Members and 1 Guest are viewing this topic.
Offline zulo

Junior Member




Java games rock!


« Posted 2006-01-12 01:04:42 »

Hi

I am about to start a new editor for my new game engine. This would be the third time i try to
create an editor. Iterative development process  Grin

This time I will implement besides sprites, actions,dialog etc. I will also use beanshell as the script.

The problem is how to design the editor. How should I build it. I want the user to be able to
add new sprites, define the animations, actions, events and more. I.e set properties. So i was thinking I could
make all the sprites etc. as beans to use in the editor. Is this a good idea or just as much work as programming all the frames,windows
and property dialogs in a normal way? Even if i make the editor able to use my beans i still have to code the actual functions and panels of property setting?Or
is this a function available in java already?

Without using beans I could select an object/sprite from a list, click a button "edit" and pass the object to a dialog which in turn knows
how to edit a sprite object etc.. Im just unsure if its easier to use beans or not.  Undecided

Thank you for any replies Smiley
Offline cylab

JGO Ninja


Medals: 38



« Reply #1 - Posted 2006-01-12 12:30:43 »

Creating all objects of your engine as full blown beans with bean descriptors and such is a bit overkill, but you should follow the bean pattern, i.e. have default constructors and setter/getter methods. There are several libraries (like http://jakarta.apache.org/commons/beanutils/) out there to analyse the class-objects to detect this properties, so you could generate the forms you need automatically.

I assume you want to build a hierarchical scene model for your engine. To save or load a model, you could use XStream (http://xstream.codehaus.org/), which provides a very easy way to serialize a complete object tree to and from XML without implementing Serializable and such. Keep in mind that XML might be the right format for an editor, but you may want to create some form of "compiled" binary-format when delivering a game for performance and intellectual property reasons.

Another way would be to create the editor on top of an plattform like eclipse (http://wiki.eclipse.org/index.php/Rich_Client_Platform) or netbeans (http://www.netbeans.org/products/platform/, the 5.0 beta IDE http://www.netbeans.org/products/ide/ has some wizards and tutorials how to create an application based on it). Using the tools provided by the Netbeans plattform (I don't know much about eclipse RCP), you will get a lot out of the box (including xml-treeviews, automatically generated editor sheets for object-properties, etc.). There is an active and helpful community around this plattform. Maybe you should ask your question in the openide mailinglist at http://www.netbeans.org/community/index.html.

Having said that, writing an editor either way - standalone or on top of netbeans or eclipse - is a daunting task. Using a plattform you have a steep learning curve, but the advantage of having tested frameworks, design patterns and extension mechanisms in place. Creating a standalone editor, you will get going faster, but run the risk of reinventing several wheels, so in the end you spend more time writing an application platform instead of an application Wink

I have already walked on both paths  Undecided  and like the plattform approach better...

Mathias - I Know What [you] Did Last Summer!
Offline zulo

Junior Member




Java games rock!


« Reply #2 - Posted 2006-01-12 14:07:40 »

thank you

I used some hours yesterday to learn beans, and how to use them in eclipse visual editor. I had never tried to program beans
before but it seems like a nice way to get easy property settings when you use the eclipse visual editor. I would customize my eclipse with beans..it
could be a mess though (? )

I was thinking of creating a beans-version of all my library objects for an editor and have a clean version for the actual game engine.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DaveLloyd

Junior Member




Making things happen fast with Java!


« Reply #3 - Posted 2006-01-12 14:44:13 »

I'll second the recommendation on XStream. I'm using to load/save my game state which is really quite complex but well handled by XStream and easy to extend. I used to use the Java beans XMLEncoder but continually hit problems with it (usually cos it is just too smart - dangerously so).

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (35 views)
2014-07-24 01:59:36

Riven (33 views)
2014-07-23 21:16:32

Riven (21 views)
2014-07-23 21:07:15

Riven (24 views)
2014-07-23 20:56:16

ctomni231 (55 views)
2014-07-18 06:55:21

Zero Volt (47 views)
2014-07-17 23:47:54

danieldean (38 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!