Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Games Center / Archived Projects / Re: Hotelbuster-v1.3, A TBS Game on: 2005-10-16 10:53:09
Hey, looks nice!
"Hotel" used to be my favorite game! ITs great =)
You need some work on the graphics though, (where's "Boomerang"? and is that "Royal"? :p),
so maybe i can help. I've done some isometric city graphics for my own games.

But first ive gotta download it, and i cant find any files on the linked site. It sais "Keine Files in dieser Kategorie"
which i think means "no files in this category". If my german is not too rusty Wink

It'd be sweet if you fixed the links
2  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-10-08 23:31:21
Yeah sure. The reason I havn't published it is because it's not cleaned up. There's a lot of old code there,
esp in the GUI section. But it will prob be helpfull anyway =)

And antoher thing: I'd really like to know if someone ever uses this code for something (just out of curiosity),
so if you do use any of it, it would be sweet if you dropped me a line so i could see what people did with it Smiley

now, you can get the complete source at www.jonask.com/pro/advancedIsometrics.zip

Best of luck,
Jonas
3  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-10-07 10:45:31
Thats great =)
I'm changing the source on all my projects to match your standard. Again, thanks for the idea.

Best of luck to you guys, and you need only to ask if you want some code
4  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-10-06 22:54:41
Smart!
I did the change, it still works under windows. Im out traveling so i cant test on linux right now, but

try replacing the imagecontroller:

http://www.jonask.com/ImageController.class

that should be an updated version =)
Hope it'll work
5  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-10-06 19:09:27
Thanks for the feedback guys.
Im working on a linux version, and it shouldn't be much work. the only problem as I see it is my picture loading algorythm.
If anyone knows how this is best done, so it works on all platforms, I'd REALLY appreciate it.

This is my code as it is now:

    //ripped from http://wiki.java.net/bin/view/Games/TextureLoadingExample, all hail them
    private static BufferedImage loadImage(String ref) throws IOException {
      File file = new File("images\\" + ref);
        if (!file.isFile()) {
            throw new IOException("Cannot find: images\\"+ref);
        }
        BufferedImage bufferedImage = ImageIO.read(new BufferedInputStream(
           new FileInputStream(file))
        );
        System.out.println("picture preloaded: " + ref);
        return bufferedImage;
    }

To adress the height problem, ive kinda got an idea.
If you look at other engines like this you'll see that tiles that are elevated and does not
have a tile behind it at the same level have an extra line drawn on them.

This picture from RCT illustrates the solution.
I was thinking maybe i could do something like that later on, but right now im focused on other elements of the game =)
6  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-10-01 20:50:55
The basic idea is very simple:

Every object on the map inherites a basic sprite class, in my engine called a MapObject.

Every mapobject har a function Draw(Graphics g) that draws it onto the graphics surface g.

Whenever an object is drawn, it's x and y coodinates are stored localy in variables called drawnToxX and drawnToY. (that is the screen coordinates, not the isometric/map coordinates)

Then, when you want to check if the mouse is over this object, simply check if it is between drawnToX and drawnToX+spriteWidth. same for Y coordinates.

Further, grab the color of the pixel at (mouseX-drawnToX, mouseY-drawnToY) from the MapObjects sprite.
If this pixel is opaque it means we found our object =)

If it is transparant it would mean this object (even though the mouse is within its boundingbox) is not the one we want, and we should proceed our search..

Code:


    //returns the object under the cursor
    public MapObject getClickedObject(int sx, int sy){
        for(int i=partnerWorld.getMapObjectList().size()-1; i>=0; i--){//move backwards through the list
            MapObject o = partnerWorld.getMapObjectList().get(i);
            int x = o.drewToX, y = o.drewToY;
            int w = o.spriteW, h = o.spriteH;
            //check if the mouse is within the object sprite
            if(sx>x && sx<x+w)//are we within this objects bounding box x-wise?
                if(sy>y && sy<y+h){//are we within this objects bounding box y-wise?
                    //get color at coord. and correct for frame and rotation sprite offset and stuff. idunno, tired now               
                    if(o.getImage().getRGB(sx-x+o.getFrameOffset()   ,sy-y+o.getRotationOffset()) >>> 24 == 255){//is this pixel opaque
                        return o;//if so, return this object
                    }
                }
        }
       
        return null;
    }



But as I said, you're gonna need alot more to get a fully functional GUI. You guys want the whole engine perhaps? its open source anyways Wink
7  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-09-29 17:24:34
Sure i'll help.

But my current GUI system i rather complex. I'll try to explain the flow...

The game runs in a seperate thread from the frame window.

Whenever a key is pressed or released or mouse moved or clikced functions are called in the frame class.
These functions store mouse and keyboard info in local variables.

Then when ever its time to update the GUI the mainloop sends these mouse states into a GUI class.
the GUI class now determins what so called GUIElement the mouse is over.

All objects you see drawn inherit from this GUIelement class, so that every object  can get mouse focus and stuff.
All the elements are stored in an ArrayList and drawn in order.
When determining what object the mouse is over you go backwards (so that the upper object is checked first) through this list,
and if the mouse IS over the element you're at now, stop reversing.
All GUIElements are square, so determining if the mouse is over it is easy. check if the mousex and mousey are within its (x,y) and (x+w,y+h)

Checking the objects in the world(buildings, tiles, people, whatever) is slightly more complicated since they are not rectangular.
But if that is what you wanna do i can show you how.

Need any code too?
8  Game Development / Shared Code / Re: Simple Full screen/Windowed Framework on: 2005-09-18 15:31:15
Very nice gode. Maybe i should make my next game for fullscreen
9  Games Center / Archived Projects / Re: Isometric Engine (RCT style) - Major update 14.Sep on: 2005-09-14 16:50:04
I've done some real improvment on the engine.
 alot of it is under the hood, like GUI-mouse handling, but one thing
i just know youre gonna like is the lanscapting tool.

This is really getting somewhere =)
10  Games Center / Archived Projects / Re: Mobile Sand on: 2005-08-09 08:47:20
yeaaah, youre right. Your simulation looks alot better too.
I get the 45 degree hills Wink
hmm, gotta think about this..
11  Games Center / Archived Projects / Re: Isometric Engine (RCT style) on: 2005-08-08 10:06:23
Yeah, i havnt done any openGL in java yet. I  guess i've allways been charmed by software rendering Wink

I'll upload the formulas i use for transforming real to isometric coordinates and back..
I never thought of expressing them on matrix form, but that might be a good way to go.
Id imagine its more optimized.

Anyways, its on my laptop so i cant access it right now. stay tuned
12  Games Center / Archived Projects / Re: Mobile Sand on: 2005-08-05 17:16:25
Thanks for the links, arielm! I've started on my own little project now. just for fun.
But i realize now how much work you must have put in your code!
The best simulation ive got so far handles about 15000 grains before it starts to drop in framerate.

great work on that Book of Sand thing btw!
13  Games Center / Archived Projects / Re: Tourist Camping Tycoon on: 2005-08-05 17:09:56
I'd like to try it too, but your sf download links are broken.
14  Games Center / Archived Projects / Re: Isometric Engine (RCT style) on: 2005-08-05 17:08:09
That is really interesting. I never got around to toying with hardware accelerators.
Would you mind sharing your code?

but i gotta add, the pixel method I use _can_ handle any shape too Wink
15  Games Center / Archived Projects / Re: Mobile Sand on: 2005-07-29 10:22:53
Truely a great game there, perfect for mobile platforms!

How did you do it?
I've been trying to simulate sand (or water) realisticly for a long time, but the computations are just too wast.
are you willing to share any code on this, i'd love to see it!
Though i understand if you won't since youre selling it.
16  Games Center / Archived Projects / Re: Isometric Engine (RCT style) on: 2005-07-28 07:28:21
Thanks for the kind words guys, I'd glady send the code if anyone is interested.
Regarding the linux issue it is probably related to my image loading algorythm.
It's not well written. doesn't work in jar files, and i suspect that is why it's not working
on your platform as well
17  Games Center / Archived Projects / Re: Isometric Engine (RCT style) on: 2005-07-26 10:15:03
I'm sorry guys, it IS 1.5. But why not upgrade?
18  Games Center / Archived Projects / Isometric Engine (RCT style) - Major update 14.Sep on: 2005-07-23 11:59:02
This a small sample of an isometric game engine.

Download: www.jonask.com/pro/iso.zip
I've been working and improving on different iso-engines over the last year, and this is small but a very apt
sample of the isometric effect.

It is a work in progress, and in this sample i have disabled all other tiles than the flat.
I havn't written in any UI to change the tilt of the tiles (like you can in rollercoaster tycoon),
but the engine supports it. If you want any other tiles you have to hardcode them in. for now.
Im working on it.


Anyhow, this is basiclly just to show off what i've done, and to see if anyone is interested in the code for their own projects.
Any kind of criticism or suggestions are allways welcome too =)

Download: www.jonask.com/pro/iso.zip
19  Java Game APIs & Engines / JOGL Development / Re: isometric map mouseovers on: 2005-07-21 12:37:31
hi, as I see it, there are two ways of doing this, one simple and crude, one complex and elegant.

simlpe methond:
If you map is flat, you can convert the screen coordinate to a map coordinate.
This will give you the map-pixel. Now you divide by the size of each tile, and you've got the tile under the mouse.
This only works if you map is flat (or else you would need a rather more complex convertion algorythm).

The complex method:
Have each tile stored as a sprite in a huge array containing all the sprites that are drawn into your isometric world.
Sort the array isometrically and make an exception so that tiles are allways beneth other sprites.
Now you must rig your sprites to store where they were drawn to each time their drawn.
When you want to know which tile the cursor is over, you need to do som Z-order stuff. like this:
Reverse through the sprite list (start at the end). This way you check the object drawn the last (ei is closest to the camera) first.
for each object in the sprite list  check if the mouse is within it's clipping box.
If the mouse is within the spritebox, you need to check if the mouse is over a oppaque part of the sprite.
If it is, this is your sprite/tile!
If it is not, reverse further down the list.

This method can be a pain to write. But once it's completed it works like a charm!
Any Questions? =)
20  Game Development / Newbie & Debugging Questions / Re: Isometric Games? on: 2005-07-21 12:21:24
Isometric games are the best, I agree Wink

I first started working on isometric engines about a year ago, but it still took me over 8 months to figure it out.
I didn't get any help from anyone, no samples, no posts. Just some good old fashioned algebra and a little trial and error.

Today i've got a tileengine like the one in the Rollercoaster Tycoon games,
and  i'm damn proud of it. So in the intrest of "my big ego" i'd gladly help you out,
BUT if you have litte experience from top-down games, scrollers and such, I am affraid
that some of the isometric stuff will seem a bit complex.

where do you want to start? i could show you some of the simple stuff first
21  Java Game APIs & Engines / Java 2D / Re: Can't get consistent FPS in Applet on: 2005-04-20 11:15:43
No, i am running it under windows. thanks for the heads up =)
22  Game Development / Artificial Intelligence / Re: A-star 101 on: 2005-04-19 23:01:57
it's hard to explain, but ill try.
i made two algorythms. one is old, and not objectoriented. It is not a real astar and was originaly made for visual basic. i've convertet it to java.

The second is a full blooded A* (at least as far as i know) based on OPEN and CLOSED lists and whatnot. followed a tutorial to make it. it's short and sweet codewise.

BUT, for reasons unknows the old algorythm is about 10 times faster. now i know that you might think (after looking at the code) that the old algorythm just checks four direction while the new oo code cheks eight. but it should not make that much of a difference!

Controles for supplied app: 1,2 SPACE and ENTER

ftp://http://www.stud.ntnu.no/~jonasas/astar.zip
23  Game Development / Artificial Intelligence / Re: A-star 101 on: 2005-04-12 19:06:52
I ment that I dont know much about java, and so Im sure people can improve on it. Thus optimizing it Smiley

BUT, one thing is peculiar. Yesterday i buildt an object oriented pathfinder, with a MUCH better algorythm. But it is 10 times slower than the VB-style code. i don't get it...
24  Java Game APIs & Engines / Java 2D / Re: Can't get consistent FPS in Applet on: 2005-04-10 16:41:17
This is the framelimiter i came up with, don't know if its any good, but it seems to work. =)

           //framelimiter-------------------------
           while(System.currentTimeMillis() < nextTick){
               try {Thread.sleep(1);}
               catch (InterruptedException e) {}
           }
           nextTick = System.currentTimeMillis() + 30;
           //-------------------------------------
25  Game Development / Artificial Intelligence / Re: A-star 101 on: 2005-03-31 09:24:07
oh, yeah, I see what youre saying...
Its alot of work to get into someones esles code.
But if there are any hard core nitpickers out there, bent on finding something to correct me on, they are still welcome to do so =)

Anyways, i'll keep that lovercase thing in mind, thanks
26  Java Game APIs & Engines / Java 2D / Re: Get pixel color from Image on: 2005-03-31 09:18:35
that worked sweet =)
Thanks!
27  Game Development / Artificial Intelligence / A-star 101 on: 2005-03-29 11:19:17
Hey,
Im all new to this site, and to java, but i've been doing VB and C for many years.
anyways, im not that smart on OOP yet, and now i've convertet my VB a* algorthym to Java.
The thing is, i KNOW it's not very optimized, but i thought i'd share it. It's implemented in a sample here,

click space to find a path

all comments and corrections are welcome.
in fact, i hope someone can help me optimize it
ftp://http://www.stud.ntnu.no/~jonasas/astar.zip
28  Java Game APIs & Engines / Java 2D / Get pixel color from Image *resolved* on: 2005-03-29 10:40:58
Hey folks,
im new here and i guess this is kinda a newbe question, but i tried searching it and couldnt find anything usefull so here goes:

I'm making an isometric strategy game, and now i need to check whether the mouse is over a transparent part of a sprite or not.
The sprites are loaded in ImageIcon objects, and stored in gifs with a transparent pallete, which i sat to regular pink (255,0,255).
Any sweet prewritten code i can use?
I'd just love a getRed() getBlue() style solution =)

Well, i'm so far enjoying java, and i hope i can contribute on this forum.
Cheers!
- Jonas
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (72 views)
2014-11-26 15:22:04

toopeicgaming1999 (61 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!