Page 1 of 3

[Help Requested]:Teamwork

Posted: 03 Nov 2013, 08:41
by nnnik
Hi
I've been working on an 2D GameEngine for AHK for a while now. 8-)
And I finally realized that this is too much work for a single person. :roll:
So I'm asking for help on this script.
At the same time I want to write down all of the work we do in a team here to give an example how to teamwork could work.


So does anybody have time and the time to help?
You should know some basics about DllCalls.
And Objects.
Anybody is welcome.

Re: [Making a Tutorial]:Teamwork

Posted: 03 Nov 2013, 08:41
by nnnik
BTW we're going to share Code on Github.

Re: [Help Requested]:Teamwork

Posted: 04 Nov 2013, 05:42
by nnnik
Also you can post here why you dont want to help. ;)

Re: [Help Requested]:Teamwork

Posted: 04 Nov 2013, 12:34
by Grendahl
Because this is posted in the Tutorials forum?

Re: [Help Requested]:Teamwork

Posted: 04 Nov 2013, 14:27
by nnnik
Well this is a Tutorial to show people how teamwork works.
A tutorial consist of two things first the theoretical part and the practical part.
I'm starting to starting to post stuff at the WE.
The current people who help:
Alibaba
Bentschi
You are free to join in anytime.

Re: [Help Requested]:Teamwork

Posted: 04 Nov 2013, 15:31
by Gio
Count me in ;)

I'm not sure as for how much time i actually have, but i'm certainly willing to drop in some code to help.

May i suggest you plan and organize the script based on the desired input/output of functions? That way it should be
a lot easier for the members of the team to work on a non-fixed schedule and actually be proceeding towards the final objective.

Example:
Function 1 definition: Receives a pointer to a bitmap and creates an object.
Function 2 definition (Requires function 1 coded): Receives objects from function 1 and organize them into a file...

User X posts a working function 1 on 04/11/2013.
User Y posts a working function 2 on 06/11/2013.
Etc.

Individual function definitions should account for code as quick/easy to implement as possible. Break a more complex function into two or more simple ones at the planning stage whenever that is possible. That way everyone can help.

Re: [Help Requested]:Teamwork

Posted: 07 Nov 2013, 09:03
by nnnik
THX for the help:
I think I'm ready until tommorow so we can discuss the specifics.
Ill also post my thoughts and results that I already have tomorrow.

Re: [Help Requested]:Teamwork

Posted: 07 Nov 2013, 12:40
by joedf
Can I join? :o

Re: [Help Requested]:Teamwork

Posted: 07 Nov 2013, 15:38
by nnnik
Yeah everybody is welcome.
Still working on the Docu.

Re: [Help Requested]:Teamwork

Posted: 08 Nov 2013, 09:53
by nnnik
The 2D Game Engine.

In this post I'm going to tell you how I imagined a 2D game engine and what my thoughts until now are.
OK first what do I want to do:

I want an Game Engine that you can use in AHK, that:
  1. Is Easy to use and understand.
  2. Is fast.
  3. Supports both MCode and plainAHK programming.
  4. And uses Class syntax.
It should be using the WinAPI, GDI/GDI+, OpenGL and OpenAL.

In order to realize this I think we should keep everything in memory and not in AHK Variables.
A Class should be used to communicate between the Memory stuff and AHK.
From now on I will call this "Memory Stuff" Game Struct.
It contains every piece of information that is needed by the engine excepting local variables and the class itself.
When I'm talking of the Game Struct I actually mean a struct pointing to other structs pointing to other structs and pointing to other structs.

So you can differ them in levels (dunno the proper word):
  1. Game Struct
  2. World Struct
  3. Type/Class Struct
  4. Object Struct
Each level is different than the one above.
The Game Struct contains a pointer to the Functionptrlist, a pointer to the World Struct and a pointer to a list of Type Structs.
The World Struct is mostly defined by the user but it also contains information about the engine.
The Type Struct contains a pointer to the Type Class Struct, and a list of pointers to objects.
The Type Class Struct can be altered by the User. It should contain every Information which all the Object of this type have in common.
Each Object contains the information that is needed to display it on screen, also the user should be able to modify this struct.
E.G. An Object has the Type Bird. Each Object Struct contains Information about the x/y coordinate and the rotation, but it also contains the current HP.
Its Type Class Struct contains its MaxHP.

If you didn't understand everything just ask.
Also here is a picture of what I just said.
Image

Re: [Help Requested]:Teamwork

Posted: 13 Nov 2013, 18:15
by Gio
Still here.

Re: [Help Requested]:Teamwork

Posted: 13 Nov 2013, 18:33
by joedf
me too. :)

Re: [Help Requested]:Teamwork

Posted: 14 Nov 2013, 11:19
by nnnik
OK that's good that was one of the most important parts.

Re: [Help Requested]:Teamwork

Posted: 16 Nov 2013, 05:15
by Alibaba
Lol. Was a week with a lot of work for me and i had no time but i'm back again. ;)
Ready for some crazy scripting. :D

Re: [Help Requested]:Teamwork

Posted: 16 Nov 2013, 09:44
by nnnik
OK now the next part:
We won't implent any physics.
So if an Object is moving it has to do it by itself.
How?
Each object has an OnTic and an OnDraw function.
The OnTic function is called every frame.
The OnDraw function is called every time the object is drawn.

What calls the OnTic and OnDraw functions and what draws the objects?
1 MCode function will do the job.
It will loop through all objects call the OnTic and OnDraw functons and Draw the object.

How do we implent the OnTic and OnDraw functions?
We'll simply add a function pointer at the beginning of the TypeClassStruct for each type of Object.

How do we call AHKintern functions with this?
The simple answer is RegisterCallback.

What are the parameters that are passed to the OnTic and OnDraw functions?
Since they are special for each type of object we'll pass the following:
  1. The pointer to the function pointer list (needed by most MCode functions)
  2. The pointer to the object that is being evaluated atm
  3. The pointer to the TypeClassStruct that is special for each type of object
  4. The pointer to the WorldStruct
  5. The pointer to the GameStruct


Ask Questions.

Re: [Help Requested]:Teamwork

Posted: 16 Nov 2013, 11:00
by joedf
Graphics engine? SDL? GDI?

Re: [Help Requested]:Teamwork

Posted: 16 Nov 2013, 16:55
by nnnik
OpenGL

Re: [Help Requested]:Teamwork

Posted: 19 Nov 2013, 12:48
by nnnik
OK so far so good.
Any Ideas for the name?
I thought of alphaEngine
I have split up the Engine into multiple parts:
  1. Wrapper AHK Class
  2. Functions in MCode that do the same thing as 1.
  3. Physics Functions (I dont have a good Name for this but simply some functions to calculate the distance between objects and..) in MCode
  4. The main rendering Function
  5. OpenGL/OpenAl classes (and MCode Wrapper Functions for OpenAL)
  6. More details in the World class
These are the topics we either need to discuss or work on.

Re: [Help Requested]:Teamwork

Posted: 20 Nov 2013, 13:56
by Bentschi
OpenAL can be wrapped as it is, but i thought of MCode-functions like echo, hall, equalizer and such, what is not part of OpenAL, but could be easily implemented.
For example you have a map in a cave, would be nice to have sounds that are like you realy in a cave.

Re: [Help Requested]:Teamwork

Posted: 21 Nov 2013, 00:59
by nnnik
Well the OnTic and the OnDraw functions can be either an AHK or an MCode function.
For the MCode function we also need some sort of Wrapper.
(I think that's my job then.
OpenAL can be wrapped as it is, but i thought of MCode-functions like echo, hall, equalizer and such, what is not part of OpenAL, but could be easily implemented.
For example you have a map in a cave, would be nice to have sounds that are like you realy in a cave.
It would be great to have soundeffects like this.