Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[java] java tile engine


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 deakin   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 January 2001 - 11:33 PM

Recently I''ve been working on a simple tile engine in Java. The basics of it are as follows: Tile images are stored in an array Map contains array of ints referencing to images Screen draws only the tiles on screen While this is relatively simple, scrolling around the map is quite slow. I''m running the application in a JFrame, would using Swing cause much of a slowdown? Thanks, - Daniel My homepage

Sponsor:

#2 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 January 2001 - 04:34 AM

Yes, the middle name of Swing is "slowness". Avoid Swing in high performance games.

BTW, I am writting a 3d tiled engine in Java. It is 3D texture mapped and currently scrolls at around 60 frames per second (depending on how much geometry you put on screen). See *early* screen shots at www.rolemaker.dk and go to the screen shots section.

Jacob Marner

#3 deakin   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 January 2001 - 09:31 PM

Thanks - I started using multiple JPanels in the game''s main window today and started getting major problems, so I''ve changed it all to use the AWT.

Is your game engine running under a JRE, or is has it been compiled to a native executable format? I imagine that 60 frames per second would be very good for an engine running under a JRE.

- Daniel
My homepage


#4 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2001 - 01:37 AM

The 60 fps is while running under JDK 1.2 interpreted. I intend later to use my native compiler (supports only JDK 1.2) so that is why I am using JDK 1.2 instead of 1.3 which is faster.

A large part of the engine is written in C++ and that keeps the frame rate up, but most of the code that is part of the game is written in Java.

Read about the principle I am using here:

http://www.rolemaker.dk/articles/WhyJavaCanBeUsedForGames/index.htm

All the C++ parts are isolated in seperate libraries that is open source:

http://www.rolemaker.dk/JWindows/index.htm
and
http://www.rolemaker.dk/JWindows/6DX/index.htm

And will only run on a system with a 3D card and directX 7 support.

Jacob Marner


#5 koatto   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 January 2001 - 11:51 AM

Felonius, i really didnt understand why you are using java for your game...What''s the real advantage respect an implementation using C++ only?
i think you "write many times to run in a single place"... sigh..


#6 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2001 - 01:16 AM

koatto,

Did you read the article I referred to above?

To summarize, the point is that Java is a language that is easier to use than C++ and gives the programmer a higher productivity. This is documented through several reports.

I cannot write my game fully in Java because that will be to limited so I split it up and write some things in C++ (those running most often and doing low level stuff) and the rest in Java. This way I can get the best of both worlds.

I am quite proficient in both Java and C++, and if it wasn''t for the speed difference and the fact that not all APIs are available directly to Java I would you 100% Java.

The fact that Java is fully portable makes it easier to port between compilers on the Windows platform, but that it doesn''t work outside the Windows platform is none of my concern. I really don''t care that Java is cross platform - I like it as a language.

I hope that answers your question.

Jacob Marner

#7 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2001 - 03:29 AM

The moral of this story, deakin... You can''t make decent games with java unless you pump it up with c.

#8 felonius   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 January 2001 - 04:59 AM

quote:
Original post by Jim_Ross

The moral of this story, deakin... You can''t make decent games with java unless you pump it up with c.


Or rather, you can''t do Java at all without C. Most of the standard libraries and the Java VM itself is written in C.

The point in using Java is that C is being hidden so many things become easier. Whether some C module is written by a 3rd party developer or is part of the Java standard doesn''t really change anything (except if you are concerned about portability).

If you want speed and don''t care that your productivity might be low then C is the solution - or even "better" use assembler for your full game.

Jacob Marner





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS