Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
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]
  ignore  |  Print  
  C++/Java Engine without GC in graphics  (Read 18735 times)
0 Members and 2 Guests are viewing this topic.
Offline abcdef
« Reply #30 - Posted 2019-11-21 02:51:27 »

Looks like Valhalla is pretty active commit wise in the jdk

http://hg.openjdk.java.net/valhalla/valhalla
Offline h.pernpeintner

JGO Ninja


Medals: 107



« Reply #31 - Posted 2019-11-21 11:53:34 »

Try to make that in Java I can promise you wont be able to run 3000 at 60 FPS.

You are to easy on primises I fear Smiley

<a href="http://www.youtube.com/v/AgxddJtSVx0?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/AgxddJtSVx0?version=3&amp;hl=en_US&amp;start=</a>

This runs on my notebook with a GTX 1060 (iirc on battery, which makes a difference, at least on my machine) in my at that time pretty ....hacky ... own engine, implemented in Java/Kotlin. It was mostly limited by the gpu in this case, because I am pretty generous with resources when I want to quickly get a result. Nonetheless, this things is not instanced, it has unique materials and unique animations per mesh - just that the mesh is all the same in this case.
Offline princec

« JGO Spiffy Duke »


Medals: 1146
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #32 - Posted 2019-11-21 13:10:03 »

You are to easy on primises I fear Smiley
We know that, but I also fear that @bullen has fallen for the Dark Side, and forever will it dominate their destiny Wink

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bullen

Senior Devvie


Medals: 17
Projects: 2



« Reply #33 - Posted 2019-11-21 14:46:40 »

Quote from: h.pernpeintner
You are to easy on promises I fear Smiley

Thanks for keeping my promise (2500 < 3000)! Wink

That said neat stuff, is it open-source?

The video description says: "2500 separately animated hellknights in Java with GPU skinning, instanced and indirect rendering".

I would have liked to feel analogue input (mouse) on the rendering because it seems the latency is high on this (watching the mouse pointer when you rotate the camera), low latency is more important than high bandwidth!

It's so easy to get high FPS if you delay frames like RdR 2 or TloU (specially the 60 FPS version that uses fibers and pushes the frames back by 2-3!).

How many FPS are you getting in your engine when this video was recorded, also are you culling?

Here is a new test where I try to limit the CPU and still render 500 animated characters, the FPS drops to 30 when I start the animated .gif recorder because of reasons!? I sleep 15 ms per frame and the rendering takes ~6 ms.

Counting cycles on windows/intel is voodoo magic, sometime it includes the cycles counted during Sleep?!

Click to Play

Included mouse shake and animation swapping for realism! Wink

But my engine needs to be felt, the latency is the lowest I have ever played!

C(++) is not fun, but the performance (and portability) makes it worth it.

That said I will still use Java on the backend, so I'm not completely corrupted by power yet.

Edit: did another recording with mouse pointer enabled:

Click to Play

The leftmost core is the .gif recorder and the engine runs on the rightmost core.

Offline h.pernpeintner

JGO Ninja


Medals: 107



« Reply #34 - Posted 2019-11-21 20:02:12 »

Haha, you're right, I'm going to invest some time and look what the current state of my engine is capable of Smiley

Yes, it's open source, but I'm a bit ashamed of it because I mostly hack this beast in my spare time while sitting in the bus and the train....so lots of hacky things in there and probably hard to read for anyone else than me. Maybe I can just write about how I did things? Would be happy to talk about some optimizations, especially regarding things where you have experience optimizing it in C++.

Regarding instancing: I'm doing regular instancing and I was generous regarding the instanced data. I have nearly everything I use as object properties as instanced properties. For example transformations, materials, animations (currently only 4 possibly active ones per object), bounding boxes. So I can go with two draw calls for main rendering. With indirect rendering, instancing or not instancing is practically the same for me, although performance would differ when you have a lot of different meshes I guess because of bandwidth. The gpu is limiting me here always.

Regarding latency: I have a triple buffer renderstate construct. The rendering/gpu stuff runs on its own thread with a Kotlin coroutine dispatcher and always goas max or is limited by vsync. Then I have an update thread that's also a coroutine dispatcher. Beginning the update frame, I have a stage where one can schedule single thread execution. That means I don't have to synchronize datastructures, but can use scheduling for synchronizing things easily. After this, all systems updates are executed ... on a coroutine context with max core count, in general maxing out the cpu or limited by the gpu. After that, the triple buffer extraction is done, single threaded. Since I wrote my own struct library, the extraction window is pretty small here because it's close to a memcopy and until now never limited me Smiley This is probably one of the things that C++ can do better, because my struct library reduces extraction time but introduces a little bit of runtime overhead in general during update.

Regarding latency, I would need to take a look at where I update my inputs, but I think it's just in the update look that runs as fast as possible, sometimes with 10k times per second and the triple buffer is updated whenever the gpu finishes a frame, so I don't know how to do that any faster to be honest Cheesy

EDIT: Regarding culling: The given video doesn't use any culling. I have a culling system that implements two-phase occlusion culling completely on the gpu, so the gpu feeds itself. It's capable of processing clusters which is my kind of "batch" and instances....but....I don't know if it pays off to be honest, don't have nice numbers yet.
Offline bullen

Senior Devvie


Medals: 17
Projects: 2



« Reply #35 - Posted 2019-12-05 16:25:58 »

I'm starting to wonder, is it time for me to build my own forum:

http://talk.binarytask.com/task?id=579711216639635462

If so I'm going to have to add SMTP to it so it can have mail too! Wink

Offline bullen

Senior Devvie


Medals: 17
Projects: 2



« Reply #36 - Posted 2020-01-05 02:10:20 »

Ok, last update since this is no longer going to be a Java project (I'm going to try and "script" with C maybe if I can hot-load the machine code).

I managed to get the engine working on raspberry 4 during christmas: http://talk.binarytask.com/task?id=4064110776042269443

47 guys at 60 FPS, bottlenecked by GPU, CPU at 30% without any optimizations, so I can make the game single threaded if I want!

OpenGL (ES) 3 is the last GL version for me, works really fast on both ARM and x86 with almost no platform specific modifications! Only since this summer did we get a workable GPU on the Raspberry for this.

I'm not going to port to Vulcan. The performance gain does not pay for the development/maintenance time!

I also managed to get my old Ouya bluetooth controller working flawlessly with the engine on the Pi:

http://talk.binarytask.com/task?id=5085281156123275887

This stuff (VC6, OpenGL ES 3, developing on linux; apt-get install dep, /dev/input/js0 etc.) is amazing!

x86 is dead, vanilla linux on ARM is the future for the desktop/console/portable! Android and Nintendo Switch are getting some hardcore competition!

Countdown to a raspberry 4 compute module powered Switch killer starts now!

Edit: at some point I will try to make a Java JNI port of the engine though, I think I will manage to make the engine hot-deploy with .so/.dll so that won't happen for a long while but eventually.

Offline bullen

Senior Devvie


Medals: 17
Projects: 2



« Reply #37 - Posted 2020-03-03 09:18:56 »

@princec I cannot PM you here it seems? I'm curious about https://www.patreon.com/posts/33715502 Why did you switch to Unity?!?

Offline princec

« JGO Spiffy Duke »


Medals: 1146
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #38 - Posted 2020-03-03 09:24:16 »

Don't know what's wrong with DMs, they've been working fine for 20 years (!).

I didn't switch to Unity, Chaz and Alli did, because of shiny shiny and toys (while I got on with the dull business of earning money with Java in my day job).
Unity makes a lot of things very easy for both artists and programmers. But it is also an incredible honey trap... fall into its sticky golden embrace and you will emerge many years later with a project so overblown in scope and polish it will never make a profit...

Cas Smiley

Offline FabulousFellini
« Reply #39 - Posted 2020-03-04 15:28:26 »

@princec I cannot PM you here it seems? I'm curious about https://www.patreon.com/posts/33715502 Why did you switch to Unity?!?

I saw that too.  That was a pretty good article.

-FabulousFellini
www.fabulousfellini.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bullen

Senior Devvie


Medals: 17
Projects: 2



« Reply #40 - Posted 2020-03-31 19:02:55 »

Hey, I'm kinda addicted to this community so I'm going to keep posting about the C(++) client since it uses a Java backend and all, hope you don't mind!

Here is the .dll hot-deployment API taking shape: http://edit.rupy.se/?host=move.rupy.se&path=/file/game.cpp&space

Replacing machine code on the fly is very underestimated!

If you think the code looks strange it is because it's designed to avoid cache misses: https://en.wikipedia.org/wiki/AoS_and_SoA

Pages: 1 [2]
  ignore  |  Print  
 
 

 
Riven (846 views)
2019-09-04 15:33:17

hadezbladez (5790 views)
2018-11-16 13:46:03

hadezbladez (2602 views)
2018-11-16 13:41:33

hadezbladez (6206 views)
2018-11-16 13:35:35

hadezbladez (1498 views)
2018-11-16 13:32:03

EgonOlsen (4733 views)
2018-06-10 19:43:48

EgonOlsen (5791 views)
2018-06-10 19:43:44

EgonOlsen (3275 views)
2018-06-10 19:43:20

DesertCoockie (4174 views)
2018-05-13 18:23:11

nelsongames (5500 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04: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!