Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 4 5 [6] 7 8 ... 10
 51 
 on: 2014-12-22 20:56:24 
Started by BurntPizza - Last post by Riven
Got inspired by basil_'s nested noise. Roll Eyes

I pondered, and decided to call it: drought (or... dried smudged clay).




As you can see, this is really powerful stuff. With little effort you get interesting patterns. It's a fair bit of fine tuning but due to the limited amount of code it's quite manageable. After applying diffuse lighting (simple N dot L) on the generated heightmap you get a good sense of the 'texture' of the material.

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  
         PerlinLayer createNoise(int octaves, float range) {
            PerlinNoise noise = new PerlinNoise();
            noise.offset(
               rndm.nextInt(rndmRange),
               rndm.nextInt(rndmRange),
               rndm.nextInt(rndmRange)
            );
            return new PerlinLayer(noise, octaves, 1.0f / range);
         }

         PerlinLayer ridgeTwister     = createNoise(4, 512.0f);
         PerlinLayer slopeTwisterX    = createNoise(8, 48.0f);
         PerlinLayer slopeTwisterY    = createNoise(8, 48.0f);
         PerlinLayer slopeTwisterZ    = createNoise(8, 48.0f);
         PerlinLayer rollingHills     = createNoise(2, 128.0f);
         PerlinLayer ridgeCreator     = createNoise(4, 256.0f);
         PerlinLayer sparseMultiplier = createNoise(4, 256.0f);

         float noise(float x, float y) {
            float z = PerlinNoiseUI.time;

            float dx = slopeTwisterX.getSmooth3D(x, y, z) * 8;
            float dy = slopeTwisterY.getSmooth3D(x, y, z) * 16;
            float dz = slopeTwisterZ.getSmooth3D(x, y, z) * 1;

            x += dx;
            y += dy;
            z += dz;

            float twister = ridgeTwister.getRough3D(x, y, z) * 128;
            float ridges  = ridgeCreator.getRough3D(x + twister, y - twister, z - twister);

            float valleyMultiplier = (0.5f + 0.5f * sparseMultiplier.getRough3D(x, y, z));
            return ridges * valleyMultiplier + rollingHills.getSmooth3D(x, y, z) * 0.33f;
         }


To give you a sense of the performance: a 512*512 map takes 175ms to render on my crappy workstation, using Java2D, performing noise calculations on the CPU.

 52 
 on: 2014-12-22 20:45:56 
Started by Olo - Last post by Olo
Since my entitys have to be rendered after the background but before the foreground, i just call the parts that need to be rendered... i digress the way im doing it is very anoying but it works for me currently

1  
2  
3  
4  
level.renderTiles(screen, xOffset, yOffset,player,1);//Background
level.renderTiles(screen, xOffset, yOffset,player,2);//Blocks entitys can hit
level.renderEntitys(screen);//entitys
level.renderTiles(screen, xOffset, yOffset,player,3);//forground


Hmm, thanks for help man Smiley And not to sound rude or anything, it's entities, not entitys Tongue (i used to write it like that too lol)

 53 
 on: 2014-12-22 20:36:25 
Started by theOne - Last post by theOne
Quote
All of that needs to be dealt with in the pathfinder, and is probably a headache. You'd need to send the pathfinder things like the Sprites width/height, so it can say: Ok this guy is 64 in height (2 tiles high lets say) so all tiles he can stand on MUST have an empty tile above it, or w/e.
I already was afraid that I have todo that like that....

let´s say on my tile can be objects, which are not visitable. How should I calculate this?
Because at the moment I only look at the tiles, if they are visitable or not.
how should I do it when an Tile is lets say to 50% visitable.
-Then I would need to check every tile for objects, but how should I store this in my Path?
Should I then store pixel values to go?

 54 
 on: 2014-12-22 20:31:21 
Started by Dreamtime - Last post by ags1
Could be a case-sensitivity issue? Just speculating... Windows is forgiving of case errors, other OSs aren't.

 55 
 on: 2014-12-22 20:23:58 
Started by Destructor - Last post by Destructor
Thanks anyway Wink

 56 
 on: 2014-12-22 20:23:15 
Started by Destructor - Last post by Jacob Pickens
A quick google revealed this:

1  
2  
BufferedImage image = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(image, "png", new File("/screenshot.png"));


https://stackoverflow.com/questions/4490454/how-to-take-a-screenshot-in-java

 57 
 on: 2014-12-22 20:09:43 
Started by Destructor - Last post by Destructor
Someone can me help solve it??

EDIT:
Finally I solved it, I made only small change, instead of:
1  
Image screenshot = new Image(gc.getWidth(), gc.getHeight());

I write:
1  
Image screenshot = new Image(gc.getWidth() - 1, gc.getHeight() - 1);

And now it works perfectly Tongue

 58 
 on: 2014-12-22 20:00:05 
Started by JESTERRRRRR - Last post by Jacob Pickens
Got back to programming and started looking what kind of style I'm going with this project.

Probably going this way Smiley

Whoa, what game is that? That is beautiful.

 59 
 on: 2014-12-22 19:58:41 
Started by JESTERRRRRR - Last post by pitbuller
Quote
So in some games, (Dungeon Keeper (#3) - the floor) when you look up close at textures they begin to curve or warp?
That's because older software renderers as well as the PS1 couldn't do perspective correct texture mapping. I don't think that you can disable perspective correction on current hardware. You might be able to set some hint but the hardware will most likely ignore it.

You just need to set interpolation type qualifier as [noperspective]. Simple as that.

 60 
 on: 2014-12-22 19:55:44 
Started by Slyth2727 - Last post by ags1
Word games... hm that is definitely a large area. I think you worked on a word game at one point, no? I could be mixing you up with someone else. Anyways, I'll add that to my list of potential subjects. I need to get started on this game pretty soon as I only have a few months, most of that will be spent working and doing school stuff. Do you have any more specific ideas?

Your chemistry idea is awesome, sounds like crafting which is all the rage.

Thanks Smiley

Yes I was working on a Word game, still am off and on. If you're curious it's on my profile page of course.

You could do a physics game based on colors - blend colors together to solve puzzles?

Pages: 1 ... 4 5 [6] 7 8 ... 10
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (10 views)
2014-12-23 03:34:11

rwatson462 (38 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

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

toopeicgaming1999 (127 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!