Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4 5 ... 12
  ignore  |  Print  
  [Slick2d] Retro-Pixel Castles > Status Icons! <  (Read 28327 times)
0 Members and 3 Guests are viewing this topic.
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #60 - Posted 2014-05-26 18:58:48 »

Hey, I am wandering how you coded placing in lots of entities?

Did you makes an array and fill it with entries of random positions or did you hard code?

I am talking about the picture that has lots of entities in it
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #61 - Posted 2014-05-26 19:07:00 »

Hey, I am wandering how you coded placing in lots of entities?

Did you makes an array and fill it with entries of random positions or did you hard code?

I am talking about the picture that has lots of entities in it

It's an ArrayList of entity objects, right now (since it's just mostly testing) entities just randomly pop up somewhere on the map when created. So if I add 500 entities to the ArrayList they just set their X/Y coordinates to (random.nextInt(mapWidth)*tileWidth, random.nextInt(mapHeight)*tileHeight) on creation. (EDIT: there's also a second check that makes sure they dont spawn in a wall or something, if that happens it just recycles and tries again)

End product obviously wont work that way though. Tongue

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #62 - Posted 2014-05-26 19:12:50 »

Hey, I am wandering how you coded placing in lots of entities?

Did you makes an array and fill it with entries of random positions or did you hard code?

I am talking about the picture that has lots of entities in it

It's an ArrayList of entity objects, right now (since it's just mostly testing) entities just randomly pop up somewhere on the map when created. So if I add 500 entities to the ArrayList they just set their X/Y coordinates to (random.nextInt(mapWidth)*tileWidth, random.nextInt(mapHeight)*tileHeight) on creation. (EDIT: there's also a second check that makes sure they dont spawn in a wall or something, if that happens it just recycles and tries again)

End product obviously wont work that way though. Tongue


Thanks just wanting to do some benchmarking on my implementation and it didn't work so well. I have an idea of what to do now
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #63 - Posted 2014-05-27 01:29:39 »

I like the lighting system of the Game. It looks very similar to the fog of war effect in games such as Warcraft 3 and starcraft, where the obstacles block visions of your units.

I would like to ask an question here,  How do you determine which tile should be lite? Do you cast rays from every light emitter in the map for checking obstacles?
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #64 - Posted 2014-05-27 04:08:23 »

I like the lighting system of the Game. It looks very similar to the fog of war effect in games such as Warcraft 3 and starcraft, where the obstacles block visions of your units.

I would like to ask an question here,  How do you determine which tile should be lite? Do you cast rays from every light emitter in the map for checking obstacles?

Yeah, now that you mention it, it does look a lot like how fog of war would generate with a player/character was talking around and exploring. Wink

I don't use any raycasting what so ever, I use a heavily modified variation of my pathfinding system. (That's based on A*) but instead of finding a path, it does the same search pattern spreading out evenly in all directions, and every tile checked gets marked as a "light source" on a byte array by adding a light value to the tile. This also comes in handy when 2 lights overlap, because both of their light values are added together on that tile, making the light blending look pretty natural.

finally, the render loop just forloops through the byte array, and any value > 1 it knows should be lit up, and places a light there with the alpha level balanced based on what the value on that tile is.

There's a little more complicated stuff going on too, like the closer to the center the brighter the light tile will be. But that's the gist of it. It's basically a lighting system based off pathfinding formulas Tongue

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #65 - Posted 2014-05-28 00:25:33 »

Quote
(That's based on A*) but instead of finding a path, it does the same search pattern spreading out evenly in all directions

Wouldn't that be equivalent to casting rays uniformly in all directions?

Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #66 - Posted 2014-05-28 01:17:43 »

Quote
(That's based on A*) but instead of finding a path, it does the same search pattern spreading out evenly in all directions

Wouldn't that be equivalent to casting rays uniformly in all directions?



yes and no, raycasting goes straight out from the center point until it hits a wall, where as mine actually curves around walls. Bright enough lights can actually completely encapsulate an object (like a bright soft light should) where as raycasting you have to do some extra layers and blurring effects to get the same kind of effect.

Here's an example using a really bright light, pointing out the areas where the soft light starts to wrap around;
Full size to see detail: http://sixtygig.com/junk/InDev-2014-05-27-8b.png



Here's another one that shows why I did it this way, allows lights to travel through passages a bit, to me, I feel it's a tad more natural because lights usually dont just cut off hard corners.. they can lightup nearby rooms not in direct paths of the light.


- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline BurntPizza
« Reply #67 - Posted 2014-05-28 01:35:01 »

It probably winds up being quite similar to the effect you get with the Radiosity technique, which is pretty cool.
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #68 - Posted 2014-05-28 03:47:47 »

Quote
yes and no, raycasting goes straight out from the center point until it hits a wall, where as mine actually curves around walls. Bright enough lights can actually completely encapsulate an object (like a bright soft light should) where as raycasting you have to do some extra layers and blurring effects to get the same kind of effect.

I see, thanks for the detailed explanation  Smiley  It makes sense to use this approach for illuminating, having Radiosity-like effect is desirable in most cases. However I feel that ray casting is probably faster since you can pre-compute the ray path and the checking stops once you hit an obstacle.

Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #69 - Posted 2014-05-28 04:23:12 »

Quote
yes and no, raycasting goes straight out from the center point until it hits a wall, where as mine actually curves around walls. Bright enough lights can actually completely encapsulate an object (like a bright soft light should) where as raycasting you have to do some extra layers and blurring effects to get the same kind of effect.

I see, thanks for the detailed explanation  Smiley  It makes sense to use this approach for illuminating, having Radiosity-like effect is desirable in most cases. However I feel that ray casting is probably faster since you can pre-compute the ray path and the checking stops once you hit an obstacle.



Depends, I think raycasting is much faster to calculate adding/removing lights or changes in the environment, but my way doesn't have to calculate anything at all except when a light is added or removed. When that's not happening, there's no calculations going on what so ever, it just renders the results in the render loop. Where as (and you guys can correct me if I'm wrong here) raycasting pretty much has to calculate some basic math all the time even in a mostly static environment.

Mine just changes the values in a large byte[][] array when it detects the need for a change, then a render loop just cycles though the array and outputs light sources all over the map.

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #70 - Posted 2014-05-28 18:27:10 »

Do you use multithreading for any thing?

I know you use it for saving
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #71 - Posted 2014-05-28 18:30:47 »

This looks nice, when do you have some kind of playable demo?
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #72 - Posted 2014-05-28 18:52:58 »

Do you use multithreading for any thing?

I know you use it for saving
Just saving right now, I experimented with sticking my light calculations in another thread and that just blew up in my face. Tongue I probably still could, but I got the lighting calculating fast enough there's no real need.

I may attempt to stick pathfinding in it's own thread though, now that my game supports 512x512 maps my pathfinding (that was designed for 256x256 maps) may not be too happy about that. But we'll see. Pathfinding doesn't need to scan the whole map anyway, it's just the longer the path, the more complex the calculations. Thus, with a 512x map there is the potential for needing 4x more calculating that originally anticipated. But even on the 512x map with a 2500-3000 entities the game is still running strong. So I should be fine. Won't know more until I switch gears back to working on gameplay to find out if it had any serious adverse side effects. Smiley

This looks nice, when do you have some kind of playable demo?

I plan to release a "map editor" edition first, that should allow everyone to make maps for the game that in-theory should be 100% compatible with the actual game once it's completed, unless I have to make serious changes to the tile engine. Don't hold me to that though, I may have to change some fundamentals in the tile engine later that may make maps made with the current version of the Map Editor null. But if people start playing with the map editor and releasing some cool maps in this thread, I may try to make a converter of some kind to keep them around.

(EDIT: Also should be important to note that even if the map will technically load in the final game, it'll be missing core game elements needed to play. For example, I haven't coded the mine shafts yet, and those are planned to be the primary way to gather ores. But nothing is stopping you from reloading the game in a newer version of the editor and adding the extra parts needed. If enough people are interested in making maps I'll probably release updated map editors as I go that have the new content.)

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #73 - Posted 2014-05-29 03:17:11 »

While the map itself isn't exactly much to look at, here's a shot of what I am currently working on. Full in-editor 1:1 map image exporting, allowing you to generate images of your map to show other people before they download:

(huge image, so you'll have to click the link)
http://sixtygig.com/junk/map0Full.png

Of course, that's not a real map. But you can imagine how it would look with a full featured map. Cheesy

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #74 - Posted 2014-05-30 00:09:48 »

Progressing on graphics some more, working on multilayered textures! Cheesy


- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline BurntPizza
« Reply #75 - Posted 2014-05-30 00:14:41 »

I just had an idea: Will there be siege weaponry?
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #76 - Posted 2014-05-30 00:23:53 »

I just had an idea: Will there be siege weaponry?

Honestly not sure yet. Most of the attacks will probably involve tearing down walls rather than climbing over them, so any siege-style weapons would probably be battering rams/catapults/etc.

I'll probably start figuring that out when I get to mobs though, as of right now there's no reason there can't be any. It's just up in the air if there will be.

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #77 - Posted 2014-05-30 01:09:35 »

One more! Bringing this game to the next "level". (har har)


- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline Drenius
« Reply #78 - Posted 2014-05-30 01:28:06 »

Yeah, looks good.
Offline Longarmx
« Reply #79 - Posted 2014-05-30 13:23:50 »

It looks very good. How many of the buttons at the top are implemented?

Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #80 - Posted 2014-05-30 16:14:11 »

Ugh I wish I was good at drawing like you are... those are some really nice graphics, very jealous of your skills!

Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #81 - Posted 2014-05-30 17:42:11 »

It looks very good. How many of the buttons at the top are implemented?

Only the minimap button. Wink

Most of the work has been on the left and right hand tabs (Both closed in the shot). But the top menu shouldn't really be all that complicated. They're all pretty basic menus. Cheesy

I plan on removing the Settings button and replacing it with an Information button that has general info about the map. (Size, name, etc) Setting will be tucked under Menu.

Ugh I wish I was good at drawing like you are... those are some really nice graphics, very jealous of your skills!

Thanks Cheesy

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #82 - Posted 2014-05-31 08:20:15 »

Hey man. How do render 512x512 maps of 8x8 tiles at 60 fps. When i do it with 16x16 tiles i go down to like 30-40 fps?
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #83 - Posted 2014-05-31 08:33:37 »

Hey man, i was wandering. How do render 512x512 maps of 8x8 tiles at 60 fps. When i do it with 16x16 tiles i go down to like 30-40 fps?

Are you rendering the tiles that are off screen? Even if they can't be seen on-screen, if you still have them rendering they're still gobbling up resources.


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
//Don't put this part in your loop, it's resource gobbling, put it somewhere that detects when your resolution is set, changed or on-load//
//NOTE: If you're using slick and using g.scale, you need to divide these values by your scale value. (Like g.scale(2,2) you'd have to divide the values below by 2)
int displayHeight = Display.getHeight();
int displayWidth = Display.getWidth();

//Assuming 16x16 tiles, your map coordinates are mapX/Y.
int mapTileWidth = 16;
int mapTileHeight = 16;

   for (int x = 0; x < mapWidth; x++) {
      for (int y = 0; y < mapHeight; y++) {
         if (((x*mapTileWidth)+mapX > -32) && ((x*mapTileWidth)+mapX < displayWidth+32) && ((y*mapTileHeight)+mapY > -32) && ((y*mapTileHeight)+mapY < displayHeight+32)){
            //RENDER YOUR TILES HERE//
           //X: mapX+(x*mapTileWidth)
           //Y: mapY+(y*mapTileHeight)
        }
      }
   }

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #84 - Posted 2014-05-31 08:42:58 »

I have something like that yet i get such low fps for 8x8 or 16x16 sized tiles.

I think i made it a tiny bit faster by retrieving screen width and height once.
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #85 - Posted 2014-05-31 08:57:32 »

I have something like that yet i get such low fps for 8x8 or 16x16 sized tiles.

I think i made it a tiny bit faster by retrieving screen width and height once.

What libraries are you using? If you're using slick you can try putting your tilemap images in a spritesheet and drawing them all at once with drawEmbedded, like so:

(My actual, unedited code, important parts are startUse, endUse and drawEmbedded)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
   public void renderBottom() throws SlickException{
      mtl.getTiles().get(0).startUse();
      for (int x = 0; x < mapWidth; x++) {
         for (int y = 0; y < mapHeight; y++) {
            if (((x*8)+mapX > -10) && ((x*8)+mapX < displayWidth+10) && ((y*8)+mapY > -10) && ((y*8)+mapY < displayHeight+10)){
               for (int l = 0; l < mapLayers; l++) {
                  if (!(mapArray[x][y][l] == 0)){
                     mtl.getTiles().get(mapArray[x][y][l]).drawEmbedded(mapX+(x*mapTileWidth), mapY+(y*mapTileHeight));
                  }
               }
            }
         }
      }
      mtl.getTiles().get(0).endUse();

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #86 - Posted 2014-05-31 09:08:30 »

Yeah, i am using slick2d. Just trying out the draw embedded now.
Online Rayvolution

JGO Kernel


Medals: 192
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #87 - Posted 2014-05-31 09:16:02 »

Yeah, i am using slick2d. Just trying out the draw embedded now.

Keep in mind, with drawEmbedded you can only draw one image at a time. That's why my entire tile map is in one single spritesheet. You'll have to plan your tile engine around that.

Alternatively, if you don't want to use your own engine you could simple use TiledMap. It might make your life a lot easier if you don't need much complexity in your map.
http://slick.ninjacave.com/javadoc/org/newdawn/slick/tiled/TiledMap.html
http://mapeditor.org

Also, there is a possibility there's nothing even wrong with your tile map, you may be bogged down somewhere else and the tiled map is just sending you over the edge.

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #88 - Posted 2014-05-31 09:23:30 »

Yeah, i have a tileSheet/tileSet with multiple images.

Just added 'bugged' implementation of drawembedded and i am getting around 50+ fps.
Just need to get it drawing correctly.


Thanks
Offline stuart6854

Senior Newbie


Exp: 1 month or less



« Reply #89 - Posted 2014-05-31 09:35:54 »

Ok, just fixed a few bugs with drawEmbedded and it works a charm. Thanks getting around 40fps now that its done.
Pages: 1 2 [3] 4 5 ... 12
  ignore  |  Print  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (42 views)
2014-08-19 09:29:53

Tekkerue (41 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (26 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (73 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!