Recent posts by qwerber on Kongregate

Flag Post

Topic: Game Programming / Unity Draw Calls

Originally posted by Draco18s:

Note:
I do not handle help requests via PM.

And that’s good for the community to share information.

 
Flag Post

Topic: Game Programming / My passion for game development is wearing out

Ever since I started working as a software engineer and writing code as a job, I felt worn out when I get home and do not want to spend more time writing code.

Does anyone else experience this? I feel like watching videos and playing games instead, but I know that game development will make me truly satisfied and productive.

I think I need some advice on this as this is really frustrating situation.

 
Flag Post

Topic: Game Programming / Elysian Shadows

If any of you have ever followed the youtube series “Adventures in Game Development”, these guys have launched their kickstarter:

SensorDropEvent()https://www.kickstarter.com/projects/1945059142/elysian-shadows-next-gen-2d-rpg

 
Flag Post

Topic: Game Programming / What's with all the hate on Unity?

What happen?

 
Flag Post

Topic: Game Programming / Webgl-Game Development

Negged for spam. Indeed he is the author.

 
Flag Post

Topic: Game Programming / GiTD #41 - *Random Generation*

Randomly Generated.

 
Flag Post

Topic: Game Programming / [Programming - C] character generator for a game

Is this a homework assignment of some sort?

 
Flag Post

Topic: Game Programming / What was that game engine called?

Stencyl?

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

As3 can not.

I don’t believe that is true, they can be packaged as an AIR application.

 
Flag Post

Topic: Game Programming / [C/C++] Optimizing a loop

+1 to Drakim and player_03.

Rather, give the particles x, y, velocity, and creationTime attributes, and then have a global currentTime value that the CPU sets every frame.

but the calculus! hehe.

Do you have any suggestions for avoid duplicate vertex stream? because it seems like to me that I have to upload x y velocity and time (5 * 4 bytes) every vertex (unless I’m drawing points) with increases the amount of data I need to push by quite a lot.

Aside from that, how do other people write their applications so that it runs at speeds like 500 fps :/? Feels like on C++ the draw calls are not as much bottlenecks as on stage3d.

 
Flag Post

Topic: Game Programming / [C/C++] Optimizing a loop

Yes confirmed. but I just realized I don’t have to update every field. That aside, what is your explanation?

 
Flag Post

Topic: Game Programming / [C/C++] Optimizing a loop

Hi kong forum, I have the following loop:

		unsigned int t = GetTickCount();

		qsb::Batch* b = _emitter->particleBatch;
		int ind = 0;
		int i = _emitter->numParticles;
		while (i--)
		{

			Vector2D p = _emitter->particles[i].position;

			qsb::batch_pushVertData(b, p.x);
			qsb::batch_pushVertData(b, p.y);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 0);

			qsb::batch_pushVertData(b, p.x + 2);
			qsb::batch_pushVertData(b, p.y);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 0);

			qsb::batch_pushVertData(b, p.x);
			qsb::batch_pushVertData(b, p.y + 2);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 0);

			qsb::batch_pushVertData(b, p.x + 2);
			qsb::batch_pushVertData(b, p.y + 2);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 1);
			qsb::batch_pushVertData(b, 0);

			qsb::batch_pushQuadIndex(b);
		}
		printf("main: %u\n", GetTickCount() - t);

with the following inline definitions of the functions in my header:

	inline void batch_pushIndex(Batch* _batch, GLuint _i)
	{
		_batch->indexData[_batch->ibDataPointer ++] = _i;
	}

	inline void batch_pushVertData(Batch* _batch, GLfloat _x)
	{
		_batch->vertextData[_batch->vbDataPointer ++] = _x;
	}

	inline void batch_pushQuadIndex(Batch* _batch)
	{
		batch_pushIndex(_batch, _batch->indexValue++);
		batch_pushIndex(_batch, _batch->indexValue++);
		batch_pushIndex(_batch, _batch->indexValue);
		batch_pushIndex(_batch, --_batch->indexValue);
		batch_pushIndex(_batch, ++_batch->indexValue);
		batch_pushIndex(_batch, ++_batch->indexValue);
		_batch->indexValue++;
	}

As you can see I have a lot of dereferencing and memory access, and I inlined the functions in hope that the compiler would optimize the code a little better.

Is there any faster/better way to do this? doing this loop 40k times on my machine is taking up 31 milliseconds which is quite a lot IMO (correct me If I’m out of my mind).

 
Flag Post

Topic: Game Programming / GiTD #40 - *Turtle(s)*

Originally posted by 0xffff5500:

I think I’ll enter this.

haha I like your name + avatar. pretty clever.

 
Flag Post

Topic: Game Programming / GiTD #40 - *Turtle(s)*

porn

 
Flag Post

Topic: Game Programming / GiTD #40 - *Turtle(s)*

exploration

 
Flag Post

Topic: Game Programming / Simple Array question AS3

When you have trouble calling a function from another class, it is usually a design problem. A common pattern I use is a “third person” that handles relations between two groups of objects.

In your case, a hotfix I recommend would be to expose all the objects you wish to access from external classes as static properties of some “Global” class.

 
Flag Post

Topic: Game Programming / Collision on a tile-based system

I personally don’t think I will ever get around to updating this tutorial but the information that is there should help:

http://www.kongregate.com/forums/4-game-programming/topics/259954-aabb-sweep-test-tutorial

The logic and algorithm is correct but better data structures, functions, and abstractions can be made (as this is a bit dated and I was not as good then as I am now).

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

Curiously, what do people use Haxe for? Other than a slightly improved AS3?

I use Haxe with openfl (not as much since I switch to cpp). I like the language but the lack of documentation for openfl and the amount of bugs, inconsistencies make me avoid it when I want to make a serious project. (OpenFL is comparable to how JS/HTML is not exactly the same across browsers).

I hear hxcpp is really good given how powerful cpp is and the high level nature of haxe. However I am doubting whether a force Garbage Collector that comes with the platform is beneficial when the goal is faster performance. Also not sure how it links with external libs.

 
Flag Post

Topic: Game Programming / Suggestion: Shootorials in HaXe

I suggest moving it toward an Entity/Component pattern as well.

I like ECS but I don’t really think it’s necessary for beginner tutorial, which should be simple and easy to understand for beginner. Maybe in a separate tutorial? + There are already so many resources for ECS and the original object hierarchy isn’t actually “bad”.

Just my 2 cents.

 
Flag Post

Topic: Game Programming / Why does this not work?

If I were you I would change the code into this:

on(press){
trace(Pies);
if(Pies >= 100){
Pie = “Chicken”;
Pies -= 100;
}
}

and check what the output is. If the output is a positive number over 100 that means you do indeed have 100 or more pies.

 
Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Is it just me or was HTML5 target out for a long time already?

 
Flag Post

Topic: Game Programming / [being updated] Haxe/OpenFL important inconsistencies

1. Initialize ALL YOUR GODDAMN VARIABLES. YES EVEN INTS AND BOOLS because on some platforms it will CRASH.

2. If you are compiling to neko (possibly native c++) and you have a class that extends Sprite, call super BEFORE you add children to itself, otherwise YOU WILL CRASH and THERE ARE NO DOCUMENTED ERRORS ON THE OPENFL FORUMS OR NEKO.

Also applies to above: Event listeners.

3. ALWAYS CALL Std.parseInt on JSON int data, not all platforms read int data the same way and I got some random turquoise color

4. When targeting C++ _callback AND __callback (2 underscores) are both reserved.

5. In HTML5 if you try to get mouse positions by Lib.current.mousex/y at the start of the application you may result with NaN, causing a chain of application breaking NaNs because Number + NaN = NaN

6. Once the mouse moves out of the window, Lib.current.mouseY returns last known mouse position as expected, but Lib.current.mouseX returns 0.
Goddamn inconsistent. This is why OpenFL isn’t widespread yet. This is on Neko and Windows.

 
Flag Post

Topic: Game Programming / Show us a screenshot of what you're working on!

Originally posted by Syurba:
Originally posted by DannyDaNinja:

I’ve heard of mystcraft, might get it some day.

Almost finished up on detention simulator, should be done within the week!

Looks good, stranger.

Reminds me of an old game where you have to fill up a cheat bar.

 
Flag Post

Topic: Game Programming / I have 2 recursive functions that use LinkedLists, need help converting them to iterative.

I know this isn’t an answer to your actual question, but do you really need the constructor in the recursive case?

Ah, thank you, I didn’t even notice that! They don’t have to be immutable my knowledge with recursion is very basic so I do not realize what values I can safely mutate.

As for your stated problem, let’s see what we can do…

I like the stack method, it almost simulates the actual stack, hehe. I think I will go with this one and after some research this seems like the typical way for conversion.

(I don’t feel like going for update_h at the moment, so that will have to do.)

No worries, I think I will try to figure out that one, thank you lots for help!

 
Flag Post

Topic: Game Programming / I have 2 recursive functions that use LinkedLists, need help converting them to iterative.

tried a lot, couldn’t do it without making things ugly. Singly linked lists.

	private function addsub_h(_sub:Sub, _lst:Cons<Sub>):Cons<Sub>
	{
		if (_lst == null)
			return new Cons<Sub>(_sub, null);
		else if (_sub.priority > _lst.first.priority) 
			return new Cons<Sub>(_sub, _lst);
		else 
			return new Cons<Sub>(_lst.first, addsub_h(_sub, _lst.rest));
	}
	public function update_h(_lst:Cons<Sub>):Cons<Sub>
	{
		if (_lst == null)
			return null;
		else if (_lst.first.remove == true)
		{
			subHash.set(_lst.first.id, null);
			_lst.first.wipe();
			return _lst.rest;
		}else
		{
			_lst.first.update();
			return new Cons<Sub>(_lst.first, update_h(_lst.rest));
		}
	}