Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  The Fog - Survive! <<Multhithreaded game logic is done!>>  (Read 6297 times)
0 Members and 1 Guest are viewing this topic.
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Posted 2013-05-05 19:59:24 »

This is my new game. It should be called Looking At Grass, because that is all you can do so far. Eventually there will be monsters that eat you, and lost people to save, villages to build, but for now, you can watch the sun rise, look at the grass, and admire my GLSL fog effects.





Here is a video showing my day/night cycle, with multiple lights and shadows:

http://youtu.be/Q5SQi75wKMM

It's built using JMonkey Engine.

UPDATE: I have got multithreaded game logic working. Entities think and do! Monsters hunt and kill, humans forage for food...

Offline HeroesGraveDev

JGO Kernel


Medals: 295
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2013-05-05 20:11:00 »

I love how the mountains and sky are always sunny, even at midnight. Wink
Is there a sun you can actually see? Or is it just a light source?

Btw, your image link is broken and I can't find the real link.
Edit: You fixed it.

Offline matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #2 - Posted 2013-05-05 20:14:54 »

There he/she is! Smiley
We've talked about you just yesterday Cheesy
(see the latest JMonkeyEngine discussion)

Anyways, looks great so far Smiley obviously needs work, but I love the shadows Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #3 - Posted 2013-05-05 20:16:25 »

Yes, my sky box needs to be dynamic - at the moment it is just a default skybox as something needs to be there for the JMonkey Engine shaders to work as expected.

You might notice in the video that the FPS is quite low - 29 or so - but that is partly because I'm recording video, and mostly because the game is running on my Radeon Mobility 3450.

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #4 - Posted 2013-05-12 21:11:23 »

I have added a dynamic sky box to the game, with changing sky color and a moving sun. All I need to do now is add clouds and stars :-)

Sun casting a shadow:



Morning:



Evening:


Offline Longarmx
« Reply #5 - Posted 2013-05-12 21:16:46 »

That last picture with the sun setting looks very nice.  Smiley I like the changing sky color.

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #6 - Posted 2013-05-24 22:59:28 »

Here is a new video, showing my weather code - I can generate lots of different cloud effects from one cloud image:

http://youtu.be/3GoODZAg7f4

I need to sort out how the mid range clouds look - they get too bright, but I'm happy with the thick and wispy cloud effects.

In addition to controlling the thickness of the cloud layer, I can also control the raw brightness of the cloud, so I can turn clouds black at night, or make very overcast skies look dark and threatening. Although the thickness and brightness jumps by large amounts in the video, I have much finer-grained control than that - for the demo I just mapped 0.1 increments to the keyboard.

The horizon gave me a lot of trouble.

Offline lastdigitofpi

JGO Coder


Medals: 14
Projects: 3
Exp: 9 years


Moebiusgames


« Reply #7 - Posted 2013-06-04 13:55:54 »

Here is a new video, showing my weather code - I can generate lots of different cloud effects from one cloud image:

http://youtu.be/3GoODZAg7f4

Nice perlin noise clouds! And a good choice of engine Wink

Follow the development on twitter:@moebiusdev or @xcylin

screenshots
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #8 - Posted 2013-06-04 19:12:28 »

Thanks. Although the clouds are not perlin noise - they are the B channel from the cloud/stars texture. I pass the image through some simple calculations to generate different levels of cloud, and various shades of gray. I looked at perlin noise and it seemed a lot of processing for something I could get from a texture. I get join lines where the texture repeats, I can't solve that yet and it is driving me crazy!

The G channel of the texture is the high altitude cloud layer - I still need to add that. Think of it... two layers of cloud with different speeds and directions, densities and cloud types Smiley

The other two channels will be stars, but I'm not sure how to get enough resolution from a 1024x1024 texture. I think I might have to make a circular repeating texture for the stars too, rather than just two star domes as I originally planned.

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #9 - Posted 2013-07-22 21:29:57 »

I put a video on youtube, titled "The Fog - Survive... with weather control":

http://youtu.be/3GoODZAg7f4

You know youtube shows a sidebar with related videos? I've been filed under 'insane conspiracy theories'. Some of the so-called related videos include:

The Chemtrail and Geoengineering Conspiracy - New Evidence August 2012
BREAKING NEWS Army has sprayed citizens with radioactive particles
Weather war big picture
Ben Livingstone: The father of weaponized weather
LITHIUM SPRAYING OVER US IN ROCKETS AND CHEMTRAILS (HD)
The US Military will use weather as a Weapon on American Citizens
...and so on.


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Drenius
« Reply #10 - Posted 2013-07-24 17:10:36 »

The clouds in the video look a little bit too low, maybe you should put them higher...

EDIT:
Maybe it's just the horizont, which shows that the clouds are just a flat planar.
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #11 - Posted 2013-07-24 19:38:44 »

Thanks, I know what you mean about the clouds being too low. I don't think my maths is wrong, I think I need to add a cheat to make near clouds seem to recede higher. It could also simply be caused by the speeded up time, which may influence the sense of how far away the clouds are.

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #12 - Posted 2013-12-12 22:30:17 »

I've started work on this one once more... the entity system and world simulation. I want to get all the entities interacting and then I will tie the sim back to the OpenGL and add in the ability to be a player in the world.

Offline AullenVerch

Senior Newbie




The univertse is vast!!


« Reply #13 - Posted 2013-12-13 05:42:16 »

Looks like a cool project! Keep it going, I like the weather video. There seems to be to much contrast between the sky and ground on the most cloudy weather setting though.
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #14 - Posted 2013-12-18 11:29:52 »

True, I need to adjust the ambient and point light sources based on the level of cloud cover, and really work on exactly how gray the clouds should be.

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #15 - Posted 2014-04-24 21:35:55 »

Still working on this project. Whenever I do some work on Fog, I get a bright idea to make some other app. My latest distraction was this, Barn Door Clock, the most obscure app ever published on Google Play:

https://play.google.com/store/apps/details?id=com.agslinda.barndoorclock

Anyway, I am now working on Fog again and I have put graphics to one side to focus on the entity system. I've written an entity system that looks a bit like an object database. The number of entities is large, but you can define indexes on the entities so the information should be slow to write but fast to read.

I also have object position stored as primitive ints with millimeters as the scale, so I can represent an area of 2000km x 2000km, sticking to positive ints.

While working on it I came up with a new (much smaller) game idea - similar to Diplomacy, but in a fantasy setting rather than WWI. It would play nicely on a small screen I think...

Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #16 - Posted 2014-08-23 21:53:43 »

My entity system is running sweetly now. I am using multithreaded logic to update about 3200 AIs in about 4ms. When game speed is increased x20, updates are still sub-10ms on my A10-5750 laptop.

I split the map into stripes and then process the all the odd-numbered striped in parallel, then all the even-numbered stripes, so that there is no chance of two threads touching the same object at the same time, or not seeing the updated state from another thread. The game does have some long-range interactions which break the system, but when I get to those I will just queue all long-distance interactions for the next frame.

I don't care so much about the user interface, so I am toying with letting it run in parallel to the logic loop. That would mean that the game would render slightly inconsistently, but would people notice ~16ms inconsistencies?

AIs are doing great. My monsters hunt for humans, and then eat them, and the humans get hungry and forage for food.

Offline BurntPizza

« JGO Bitwise Duke »


Medals: 271
Exp: 5 years



« Reply #17 - Posted 2014-08-23 22:02:26 »

Your persistence with this project is admirable. I love that feeling when a complex redesign of a system is completed successfully.

I don't care so much about the user interface, so I am toying with letting it run in parallel to the logic loop. That would mean that the game would render slightly inconsistently, but would people notice ~16ms inconsistencies?

Perhaps have something like this to couple the UI to the game loop?
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #18 - Posted 2014-08-23 22:15:34 »

Hmmm... the game world is currently 6km x 6km, but the UI is only rendering 0.6km x 0.6km at most (much less most of the time, the game is called Fog after all  Grin), so we don't need to queue most elements. Maybe I need to grab the entities near the camera and render them upfront, pass them off to the UI, and then carry on with the logic for the rest of the world.

Thanks for the compliment about persistence. I have a problem that I get distracted by other projects... but I really want to finish this.

Offline BurntPizza

« JGO Bitwise Duke »


Medals: 271
Exp: 5 years



« Reply #19 - Posted 2014-08-23 22:29:15 »

I guess I meant the GUI, however now that I think about the misconception, I realize GUI being on separate threads is normal anyway...

For separating rendering and logic, a common system is for the logic thread to send snapshots of each logical frame to a queue, from which the render thread consumes the most recently computed frame, sometimes (if you're fancy) interpolating multiple frames.
Offline ags1

JGO Wizard


Medals: 72
Projects: 3
Exp: 5 years


Make code not war!


« Reply #20 - Posted 2014-10-18 20:49:12 »

Doing CPR on my thread... :-)

I have been using the random terrain in jME up till now but terrain is fundamental to the game so i needed something more under my control. I used OpenSimplexNoise and some school maths to build an island generator. In terms of scale the island is about 6km across. The dark green areas are above the fog so they are safe to build in (usually) while the light green areas are under the evil fog. White is mountain that gets rendered differently and is impassable, but isn't part of the gameplay.


Pages: [1]
  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.

SHC (24 views)
2014-11-25 14:00:59

SHC (24 views)
2014-11-25 13:53:45

Norakomi (22 views)
2014-11-25 13:26:43

Gibbo3771 (22 views)
2014-11-24 21:59:16

trollwarrior1 (36 views)
2014-11-22 14:13:56

xFryIx (74 views)
2014-11-13 14:34:49

digdugdiggy (52 views)
2014-11-12 23:11:50

digdugdiggy (46 views)
2014-11-12 23:10:15

digdugdiggy (41 views)
2014-11-12 23:09:33

kovacsa (69 views)
2014-11-07 21:57:14
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-10 00:35:00

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

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

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

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

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

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

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