Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Procedurally generated HTML5 3D world with day/night cycle (endtime.at)
165 points by zabast on July 20, 2015 | hide | past | favorite | 36 comments


I have built sky simulation for small spheroidal planet for a (now) very obscure game.

https://www.youtube.com/watch?v=RjAyq2kmGT8 - I left at the time trailer was recorded, but effects like day of time are still look like my work (as are explosions, it seems).

As I haven't had enough experience then, I made your mistake - there was no difference between dusk and dawn. And, in fact, there is.

The dust that gives red color of the sky sets down before dawn (pun intended). Thus dawn glow is much less reddish and more like red gold.

(overall effects like intensity of light can be computed from cos(sun light angle to player's normal), subtle effects like change of glow's color can be computed from sin(sun light angle to player's normal), just in case)

In your simulation there's no anisotropy in color of the sky. And this is HUGE mistake. Sky's diffusion and reflection is very anisotropic and omitting this gives your simulation very unnatural feel.


Performance was fine for me and I am on a dated machine (Lenovo Z560) running Firefox with about 20 tabs open.

I discovered this game some time ago, from the CopperLicht engine home page[1]. I am a web-developer by day and an amateur 3D designer after dark, looking to build something similar. If the creators of End Time are here, can they (or anyone with experience in this domain) share some insight about the development process, especially procedural world generation?

[1] http://www.ambiera.com/copperlicht/


I programmed that. I also wrote that CopperLicht library. So feel free to ask about that on the CopperLicht forums as well if you are using it anyway.

It is nothing really complicated: I created a deterministic randomizer class, and generating the worlds 3D geometry based on each squares coordinates as random seed. Terrain is currently based on a simple sin/cos function, buildings are built from blocks like minecraft does it. See the third Copperlicht tutorial in its documentation on how to create own geometry and stuff.


I'm using Chrome and Intel HD graphics 4600. It kinda stutters/drops frames.

I know it's a crappy graphics card, but this demo isn't some magical eye candy either, and there's not even a lot of gameplay going on.

I'm not sure if the problem is actually on the graphics programming side of things (bad shader maybe?) or it's just the javascript being slow.


I'm using a low-end Chromebook (Lenovo N20) and it runs smooth...


Same here. 240 $ chromebook and it runs great. Me likey.


Running smooth on a first gen mac book pro retina here in Chrome. This machine is several years old. Are you sure there isn't something else using a lot of CPU in your system?


Works fine for me (win 8, 6 gigs ram, chrome)


right now is probably not easy to think about procedurally generated worlds without thinking about no mans sky: http://www.no-mans-sky.com/about/


It comes to my mind quite often as well. I can't wait for release.


When is it supposed to be getting released?


I don't know. Hopefully before Half Life 3, or at least before the heat death of the universe. Anyway, I've been hearing about this game for quite some time now and I really, really like the idea so I wish for a release someday soon :).


Wow, that's something! First one that comes to my mind, though, is mars - https://www.youtube.com/watch?v=_zSjpIyMt0k


It'd be nice if there's some text/blog post about how it's done etc.


My first though was: "I could make a game with this". And the first thing on my todo-list would be "server rendering", so that the server only send the client what the player see.


This isn't really feasible using current technology, at least not if you care about player experience. Input lag is killer, and users are far less forgiving of it than with something like netflix, where lag between the server sending data and the client receiving data is fine (Keep in mind that most pixels change most frames in a first-person 3d game, so it doesn't compress all that well either). Even a couple frames of lag is noticeable at 30fps, and isn't really something players forgive. Not to mention, players tend to expect 60fps now...

There's also not really a lot of benefit to doing something like this. Maybe you run better on computers that have worse graphics cards (and I don't actually think you will), but you'll run worse on computers with worse internet connections. You also are now spending a lot more on servers because every player needs a nontrivial portion of a server machine.


> There's also not really a lot of benefit to doing something like this

If you have any kind of multiplayer game: It would make cheating harder, and make some kind of cheats impossible.


I suppose it could help somewhat (at least the client wouldn't have to keep that huge world in memory), but now you have to deal with sending input to a remote server over an unreliable connection, and also being able to steadily render and compress about 180mb of data per second on the server side, and get it back to the client within a second to achieve 30fps @ 1928x1080. I think this will definitely be noticeable (I remember experiencing a noticeable delay with OnLive even though the connection was pretty good).

The real solution would probably be finding an effective way of dealing with memory on the client side. I don't know what the state of the art in javascript land is but big environments like this are better streamed from disk into memory portion by portion rather than putting it there all at once (i'm pretty sure there is no standard api that lets you do something like this).


There's a few optimizations techniques that you can apply, like sorting.

You keep track of all the points the player is currently looking at, and sort them. Then when the world state is updated, the server check all clients whether to send the new update or not.


Great job! Now, if we can procedural generate a Dwarf Fortress game with a graphically HTML5 procedural generated world. Think Elder Scrolls Morrowind in HTML5. No-Mans-Dungeon.


I wonder if anyone's ported Vulture's Eye to asm.js...

(yeah, I know it's 2D isometric and not real 3D, but it's still pretty, and it's still a fully-functioning roguelike)


Dwarf Fortress hasn't gone to such a view because of the huge complexity with the UI. You can have 3d isometric views today if you want.


I like this, it's very very neat and what's cool is seeing how the electrical wires and poles are generated and how at some junctions you'll see them criss crossing in an unnatural way, like a city planner or construction crew messed up. It's neat.


Don't know what caused it, but opening the page totally froze my box. (I had to power it down)


Same. Running Arch, my display driver had some kind of attack of the vapours and I had to reboot the box blind. Fun!


One detail I appreciate is getting the right cut/fill for road strings.

You do have to have be careful when applying this carte blanche on procedurally generated terrain, as you can end up with all sorts of unrealistic/dangerous/fun? cases.


The first thing I did was walk into a building and try to go up some stairs. I got wedged between the stairs and the wall and couldn't move. There doesn't appear to be anything you can do at this point but close the page.


Same thing happened to me. I also saw that a tree came through a building. I was just surprised that the building had collision detection :)

Cool demo though


- My firefox get crashed - My device driver get problem but self recovered later. - Other applications get hung, too.

when i keep my mouse and drag around screen. How can one JS application can make my computer dance ? Great game.


Make sure you have the latest driver for your video card.


What's the yellow arrow?


Has some common mistakes (sky color rendering is pretty chunky, for example) but is otherwise very compelling.

Sad to think this poignant simulation will eventually become just another zombie shooting club.


Reminds me Infinite Oz (https://youtu.be/U8Pu26G2jQY) but I do no know which technique was used.


The hazy atmosphere, the day-night cycle, the empty houses without windows or doors... All I can say is

"Get out of here stalker".

And that's not bad at all.


Word map should probably be world map.


Beautiful work, HTML has come a long way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: