What I did today

Yes. It’s not bullet unfortunately. At least not in the way we normally know it, anyways.

Made some 3D dithered lighting this week.

More aesthetic:

Clearer but less aesthetic:

Finally dropped ClearWindows, ClearVG, and ClearDialogue. Please check out their threads to learn more about them:

I’ll try and get some binaries out for ClearDialogue as soon as I’ve finished all of the testing so that you guys don’t have to clone the repo to get it running.

Special thanks to orange451 and Spasi for helping me get all this working.

Working on the final project for my Computer Graphics class at uni. Unfortunately the professor is making us use Java3D. I can’t change his stance on it either.

Here it is so far…

http://magaimg.net/img/7t0o.png

Released Faerie Solitaire Harvest:

Tenuous Java connection:
It’s written in Defold, which is a 2D games development platform from King; the Defold IDE is written in Clojure and JavaFX.

Cas :slight_smile:

Nothing too exciting here but I am finding a little time to write code again. Here is some basic path finding, will help with the computer car movement at somepoint:

Congrats on the release, looks polished.
I checked out Defold and noticed that there’s lots of references to Lua. Is this the language that you program in to make games in Defold? Or is it just a scripting language to connect things you’ve programmed in some other language? Would be interesting to hear about your experiences with it.
Cheers,
Keith

It is actually Lua, yes. I’ve not personally made FSH, it was Brian Kramer of Subsoap who did the game with his brother Matt. Brian draws, Matt codes. According to them it’s been absolutely great to use. Lua is a very nice scripting language as well - very simple, but powerful.

Cas :slight_smile:

Thanks for explaining. Two brothers creating, that’s great. Good on them for sticking it through and finishing

Spent the entire week working on a high performance TCP handler/wrapper that does connect/disconnect/read/write asynchronously. Communication is done via packets (preamble-byte, payload-length,payload-bytes,postamble-byte) to give some structure to the TCP stream. Packets are passed around in ArrayBlockingQueues and get pooled to avoid allocations.

The packet-objects offer a ByteBuffer like interface to read/write primitives and primitive arrays, implemented with Unsafe.

I think it’s pretty fast already, below is a screengrab of the impact it has on my dual core laptop cpu while there are 500 clients connected to a single server over loopback. The server gets bombarded with 10000 messages per second (with 1416 byte payload each). That’s 27 kilobyte/s per client, resulting in 113 Megabit/s total, all running on the same machine.

The server process itself uses around 2 - 2.5% of the combined cpu resources while the 5 processes with 100 clients each hover around 0.15% per process.

Anybody know similar frameworks/libraries? Do you know something faster than ArrayBlockingQueues for inter-thread message passing?

Jocket perhaps, for socket-like comms?
Disruptor for queueing?
Not used either myself.

Cas :slight_smile:

@VaTTeRGeR, have a look at Aeron.

@princec Thanks! Jocket does interesting stuff for IPC, i want to do network communication though so this sadly isn’t applicable. I had look at disruptor some time ago already and had the impression that it contains lots of bloat specific to financial applications, i just need a fast SPSC queue to move stuff between two threads. After looking into it some more i found this talk by LMAX: https://www.youtube.com/watch?v=DCdGlxBbKU4 I need to see if i can extract just their ringbuffer implementation, the performance seems to be much better than what ArrayBlockingQueue offers.

@Spasi
Aeron and the serialization library it uses employ some techniques that i have already incorporated, thanks for the tip! This talk of theirs was kinda interesting, worth skipping through at least: https://www.youtube.com/watch?v=tM4YskS94b0

Edit: Just implementing the Ringbuffer from the LMAX talk gives me performance that is around an order of magnitude greater than ArrayBlockingQueue with high consistency at the cost of possible overflows if the buffer is to small, here’s the code:

import java.util.concurrent.atomic.AtomicLong;

public class RingBuffer <T> {

	private final int SIZE;
	private final T[] data;

	private AtomicLong sequence = new AtomicLong(-1);

	private long nextValueWrite = -1;
	private long nextValueRead = 0;
	
	@SuppressWarnings("unchecked")
	public RingBuffer(int size) {
		this.SIZE = size;
		this.data = (T[])new Object[size];
	}

	public void put(T packet) {
		
		long index = ++nextValueWrite;
		
		data[(int)(index % SIZE)] = packet;
		
		sequence.lazySet(index);
	}
	
	public T get() {
		
		if(nextValueRead <= sequence.get()) {
			return data[(int)(nextValueRead++ % SIZE)];
		}
		
		return null;
	}

	public synchronized void clear() {
		sequence.set(-1);
		nextValueWrite = -1;
		nextValueRead = 0;
	}
}

The latency has gone down from jumping between 1 and 40 us to below 0.8us consistently, it’s so fast that the resolution of System.nanotime() isn’t sufficient to measure it anymore :o it seems to use discrete steps of 411ns from what i can see and the ringbuffer put() is most of the time at or below that mark.

I can now fetch a packet from the pool, fill it’s buffer with ~1400 bytes of data and send it back to the socket-write-thread in ~4 microseconds average.

for (int i = 0; i < 5; i++) {

	long tStart = System.nanoTime();

	SocketQueuePacket packet = queue.getPacketFromPool();
	
	//System.out.println("Remaining before: " + packet.remaining());
	
	packet.putByteArray(payload);
	
	packet.putIntArray(new int[] {1,2,3,42});

	sumBytes += packet.position( ) - SocketQueuePacket.HEADER_SIZE;
	
	//System.out.println("Remaining after: " + packet.remaining());
	
	while(!queue.write(packet)) {}
	
	long tDelta = System.nanoTime() - tStart;

	System.out.println("Send time: " + TimeUnit.NANOSECONDS.toMicros(tDelta) + " us / " + tDelta + " ns");
	
}

This gives me:

[quote]Kilobyte/s: 140
Send time: 15 us / 15615 ns
Send time: 4 us / 4109 ns
Send time: 7 us / 7397 ns
Send time: 4 us / 4109 ns
Send time: 2 us / 2877 ns
Kilobyte/s: 139
Send time: 8 us / 8630 ns
Send time: 2 us / 2466 ns
Send time: 1 us / 1233 ns
Send time: 2 us / 2877 ns
Send time: 1 us / 1644 ns
Kilobyte/s: 140
Send time: 9 us / 9862 ns
Send time: 1 us / 1644 ns
Send time: 1 us / 1233 ns
Send time: 1 us / 1644 ns
Send time: 0 us / 822 ns
[/quote]

Long time not posting any progress, but it is huge from the last point when I reported. Still some work to be done before releasing a demo, but already getting close there.
In last two month the following was done:

  • Implemented and scripted small tutorial
  • Integrated new UI (bought one, I am not good in PS at all)
  • Implemented dialogues (so the story telling can be done)
  • Integrated shadows for game objects (had a difficulty, since Blender would render a huge shadow around the object with very small but noticable alpha, so had to implement additional step in my asset management tool to remove alpha below threshold and make blur the remaining shadow, otherwise it would look edgy).
  • Implemented traps (to be placed in the forest) and collect objects feature

Below some screenshots are following :slight_smile:

The main menu window:

Campaign map:

Level description and objectives:

Tutorial

Dialogue

Made a search field in LWJGUI

http://magaimg.net/img/7usd.png

Works just like a text field, but has a search button, a clear button, and a search event that you can create a listener for

[EDIT]
Also implemented the Gear Demo as an example of deprecated opengl mixing with my UI

http://magaimg.net/img/7utm.png

What’s fun about this, is it can easily be placed inside of my OpenGLPane class, and then be drawn alongside UI, instead of JUST underneath it:

http://magaimg.net/img/7uwu.png

Won the Vex Robotics World Championship!

This is mostly why I haven’t been coding at all for a while :stuck_out_tongue:
I’m in this picture but it’s up to you to guess who I am

@cygnus Neat! Brings me back to when I did Vex in high school. I competed at world’s twice but never came close to winning.

Finally finished all of the features I wanted for ClearDialogue. Got scaling working with ClearVG last night (was a bit tough but it worked out in a way I like). You can adjust the program scale per component, so you can have one aspect of your UI be at one scale and another aspect at a different scale. Meaning that ClearDialogue’s canvas can be scaled differently from the UI itself. It’s extremely flexible and I’m quite happy with it. It was easier than I thought it’d be, honestly.

I also got ClearVG working in non-ClearWindows applications (as in, we got it working with one of our internal NNGINE projects). Meaning that it’s confirmed that it works in contexts where the user wants to use ClearVG but not ClearWindows. So to summarize, ClearVG will work with any GLFW windowing solution (or really any OpenGL context) you want. Again, nice and flexible like I intended.

It’s a shame that no one seemed to have seen them when I posted them, but hopefully it’ll help at least one person down the line. They’re both open source and contain a lot of utilities from NNGINE as well as some new stuff exclusive to them, so they’d be useful for anyone wanting to have a shortcut past the tedious GLFW stuff you usually have to do to get a project going. Here are the project pages I made for them if any of you want to check them out:

ClearWindows & ClearVG:
http://www.java-gaming.org/topics/iconified/38899/view.html

ClearDialogue:
http://www.java-gaming.org/topics/iconified/38900/view.html

@kingroka123 team number?

@cygnus 5203 I don’t think my team has been back to worlds since I left