Malohkan
|
 |
«
Posted
2004-11-18 02:17:14 » |
|
In developing Rimscape, my designer's been thinking, "since so many people are having trouble with the layout built for small scales, let's have another one available for the PC version that'll be good on the large scale." He's done up some shots for what the new scheme will look like, and while it looks nice, it screams "I eat Java2D for breakfast muhahaha". I'm really gonna need to abstract my rendering code so that I can use either Java2D or OpenGL. I need to have working code using standard Java2D because of the need to support machines that won't handle OpenGL, but I'd like the new layout to be connected to it. As much time as I'm putting into developing the gameplay aspect of the project, I just cringe thinking about not only having to abstract the rendering code, but to also have to learn LWJGL in order to make this happen. Is anyone interested in perhaps helping make my game render with the option of OpenGL or Java2D? My initial thought is that I'd probably be willing to pay someone $150 to do it, but don't quote me on that  However, to anyone who agrees, I'll be sure to have a price finalized before you undertake the project. Discussions are very welcome. I'm in much need of help :-D Volunteer services are even more welcome, as I'm a broke college kid with nothing more than dreams and a tight budget and like 30,000 lines of code for one game on which I'm the only developer  I'm in need of some help here. Thanks! 
|
|
|
|
oNyx
|
 |
«
Reply #1 - Posted
2004-11-18 02:33:13 » |
|
|
|
|
|
Malohkan
|
 |
«
Reply #2 - Posted
2004-11-18 03:46:35 » |
|
I have looked at that in the past, but it does so very little. I'd probably have to develop so much it wouldn't be worth the time. Last time I tried it it was essentially useless. I informed the developers of the problems, and when I check the site, their last posted update was a response to my information. That shows that they're really not developing it at all. Also, it's under the BSD license, which totally removes my interest.
So essentially I don't think J2DA can help me :-/
|
|
|
|
Games published by our own members! Check 'em out!
|
|
oNyx
|
 |
«
Reply #3 - Posted
2004-11-18 04:04:58 » |
|
>Also, it's under the BSD license, which totally removes my interest.
Huh? BSD is great. It basically allows you to do everything you like with the code. LWJGL for example uses a BSD style license, too.
|
|
|
|
kevglass
|
 |
«
Reply #4 - Posted
2004-11-18 07:04:11 » |
|
Actually, I'd thought J2DA was abandoned (i.e. we all stopped work), but someone has picked it up, isn't O/S wonderful  I would have thought for rimscape J2DA would be a pretty good fit. You are just using sprites and rotating them right? It seems to have limited GUI support again now. Kev
|
|
|
|
Malohkan
|
 |
«
Reply #5 - Posted
2004-11-18 12:43:05 » |
|
Hmmm I'll give J2DA another look then  My discussion on their forums gave me the impression that because of the BSD license I would have to pay them royalties for using it. Maybe that was just me misunderstanding.
|
|
|
|
Matzon
|
 |
«
Reply #6 - Posted
2004-11-18 12:51:56 » |
|
eek! BSD (the modified one) - is the second most liberal license! Only public domain is more liberal (it doesn't require you to include copyright notices, unlike BSD).
|
|
|
|
cfmdobbie
|
 |
«
Reply #7 - Posted
2004-11-18 14:48:13 » |
|
Yeah, BSD rocks. The BSD license in one sentence: Here's the code; do what you want, but mention our name somewhere.
Naturally, you should read all licences carefully and consult a lawyer before doing anything rash with someone else's code!
|
Hellomynameis Charlie Dobbie.
|
|
|
Malohkan
|
 |
«
Reply #8 - Posted
2004-11-24 16:37:47 » |
|
After re-reading through their forums, the problem, I remember now, was that they plan on re-licensing under GPL after getting mp3 support with a project under GPL. Aside from that, I ran their example, and it was beyond slow, like, literally painful to play under JOGL. It also has no LWJGL support, which always works better for me (and as I've seen in the forums for everyone else also).
So with that said, J2DA is still completely useless. I am still open to anyone who will help me enable LWJGL for Rimscape. I'll pay you AT LEAST $150 and am open for negotiations further.
|
|
|
|
cfmdobbie
|
 |
«
Reply #9 - Posted
2004-11-27 09:56:12 » |
|
Well, just because they re-licence to GPL doesn't mean your BSD licence for the current code expires. But it does rather limit your ability to upgrade later. :-/
|
Hellomynameis Charlie Dobbie.
|
|
|
Games published by our own members! Check 'em out!
|
|
blahblahblahh
|
 |
«
Reply #10 - Posted
2004-11-27 11:30:24 » |
|
After re-reading through their forums, the problem, I remember now, was that they plan on re-licensing under GPL after getting mp3 support with a project under GPL. Damn. Should have licensed original under a "viral" BSD and copied the GPL idea. The GPL gained ground largely because it prevented other people from "un-GPL'ing" the project at a later date. To "un-BSD" the project and turn it into the GPL (which can never be "un-GPL'd") is real nasty. The new maintainer seems a bit useless, going by his forum posts: he wants to un-BSD the project (no mention of this on front page, anyone could start using the proejct now and find the project suddenly disappears if they were relying on BSD license) and can't think of a point to having proprietary classes like J2DAColor, and implies that "people who have any expreience of Graphics2D should not be using this library". Maybe not, maybe he's just a bit terse or simply too busy to think before he types, but he just seems unhelpful.
|
malloc will be first against the wall when the revolution comes...
|
|
|
kevglass
|
 |
«
Reply #11 - Posted
2004-11-27 12:19:52 » |
|
Its a rare circumstance that someone actually does want to use J2DA. Normally the sacrifice to get a consistant look across multiple rendering technologies is just too high.
Kev
|
|
|
|
Malohkan
|
 |
«
Reply #12 - Posted
2004-11-28 02:57:30 » |
|
And in my case I don't want a direct link. For Java2D there are a LOT of times when I want to buffer some stuff I've drawn that I should only have to redraw occasionally, whereas in OpenGL that's a BAD thing to do and I wouldn't want to buffer anything. If I just have one code source going straight to J2DA, I can't get any balance of the two strategies, I'd just have to draw everything all the time, making my Java2D mode way slower than it is now. So essentially I really DO need separate rendering code for each mode, especially considering I'd like to throw in some OpenGL effects in here and there when available  Cas has tried a bit to get my started with the Shaven Puppy Gaming Library, but unfortunately the most he has time for is to throw some things at me that he's created which I can't make heads or tails of. I'm completely overwhelmed and unfortunately he just doesn't have the time to give the help his good intentions are trying to give  So essentially... I'm still willing to pay one of you guys to help me  Each little tidbit Cas shares with me makes me less hopeful that I can figure this out. Way too much conversion between the two sources is just boggling my brain. As I explained up top, I need someone comfortable with how the LWJGL resources work so that I can create a compatible link. Otherwise I'm afraid I'll just be tugging at Cas's arm all day long trying to get him to baby me along. I don't want to waste anyone's time  It's not as simple as me just learning to use basic LWJGL features. It's much more. I have to use them and make all of my GameLizard mess work both ways. That means when I modify Rimscape, I want to be able to upload the same Rimscape code to update the Applet version and the Webstart + OpenGL version. Is anyone even interested in my offer?
|
|
|
|
Middy
Junior Member  
Java games rock!
|
 |
«
Reply #13 - Posted
2004-11-28 09:21:19 » |
|
Well I would if I had the time 
|
When do I get my makeMyGameAsILike() extension?
|
|
|
princec
|
 |
«
Reply #14 - Posted
2004-11-28 12:25:45 » |
|
KegGlass might be able to help - he's just got it all up and running. Or OrangyTang. I'm just too busy for the next couple of weeks releasing a new game... Cas 
|
|
|
|
kevglass
|
 |
«
Reply #15 - Posted
2004-11-30 06:07:42 » |
|
I'm pretty bogged down with Gravity Battle at the moment. I guess it depends on how seperated your data model and rendering already are?
Kev
|
|
|
|
Malohkan
|
 |
«
Reply #16 - Posted
2004-11-30 06:43:03 » |
|
actually I've just been pondering the idea of how to best organize that. I could go ahead and do the separation/abstraction work so that you could just make parallel classes to go along side the stuff.
I was thinking of a design sorta like... public class Projectile implements ProjectileRenderer { }
and have a ProjectileRenderer that used OpenGL and also a ProjectileRenderer that uses Java2D, right? How exactly would I implement that? I imagine I'd have a big static RenderDistribution class or something that I would call every time I need a new object that has a renderer. But I don't know how the RenderDistribution class would be required to act in terms of the actual code for creating a Projectile with the proper renderer.
Could I get some pointers on how I need to organize this?
|
|
|
|
kevglass
|
 |
«
Reply #17 - Posted
2004-11-30 07:01:53 » |
|
Just typed.. no compiler handy.. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| public abstract class Projectile { protected int type; protected int x; protected int y;
public abstract void render(RenderContext context); }
public class LWJGLProjectile extends Projectile { private Sprite sprite; public LWJGLProjectile(int type) { this.type = type; }
public void render(RenderContext context) { update sprite location; } }
public class Java2DProjectile extends Projectile { private Image image; public Java2DProjectile(int type) { this.type = type; }
public void render(RenderContext context) { render image at the correct location } }
public abstract class EntityFactory { public static EntityFactory getEntityFor(String type) { if (type.equals("LWJGL")) { return new LWJGLEntityFactory(); } return new Java2DEntityFactory(); }
public abstract Projectile createProjectile(int type); }
public class LWJGLEntityFactory extends EntityFactory { public Projectile createProjectile(int type) { return new LWJGLProjectile(type); } }
public class Java2DEntityFactory extends EntityFactory { public Projectile createProjectile(int type) { return new Java2DProjectile(type); } } |
This assumes that you want to stay one player and not networked multiplayer. If you were going to do that I'd suggest you seperate data and rendering completely... i.e. delegation not inheritence. Kev
|
|
|
|
Malohkan
|
 |
«
Reply #18 - Posted
2004-11-30 13:54:49 » |
|
oooo  Yeah networked multiplayer will happen one day with a different game. That was exactly what I was looking for, thanks! It shall be done 
|
|
|
|
Malohkan
|
 |
«
Reply #19 - Posted
2004-11-30 17:44:25 » |
|
holy hell I remember now why I want to pay someone $200 to do this  What a mess! This is hard as crap and I have no idea if it's going to work or if I'm doing it right. Big complicated project + never having done this before = big desire to pay someone better with this concept to do it for me.
|
|
|
|
Malohkan
|
 |
«
Reply #20 - Posted
2004-11-30 19:35:08 » |
|
OK I've organized what the responsibilities of all the Classes I have that have any connection with rendering and tried to catalog what exactly they need to do. Maybe this'll give you a better idea of what I'm dealing with. This should help ME most of all to decide how to organize the code for abstracting all of this. Here it is: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Weapon - keeps track of the sprite used for its children Ammo(Beams/Projectiles) which are subject to change at any time. It manages this variable state and gives the Ammo the sprite they need to use (Java2D - BufferedImage / OpenGL - Sprite) Beam - Sprites given by the Weapon Projectile - Sprites given by the Weapon AsteroidManager, FloatingObject, Ship, Thruster, Planet, Explosion - sprites IndicatorManager - sprites saturated with color - Java2D mode needs to hold on to the saturated creations in a Hashtable, OpenGL probably doesn’t care for this efficiency work
Console - text and fading text
MainScreen - draw sprites - draw HUD o text, gradients
All of the Menu implementations - draw sprites - draw lines - be able to do all of this within certain Clip regions if necessary - Java2D mode should be caching stuff that doesn't change like it currently does, OpenGL mode could juts ignore the state variables deciding whether or not to update and just draw everything every frame - NavMenu o Draws sprites, and lines both saturated with various colors o Draw text of various colors |
|
|
|
|
|