[Help Requested]:Teamwork

Helpful script writing tricks and HowTo's
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

[Help Requested]:Teamwork

03 Nov 2013, 08:41

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.
Recommends AHK Studio
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Making a Tutorial]:Teamwork

03 Nov 2013, 08:41

BTW we're going to share Code on Github.
Recommends AHK Studio
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

04 Nov 2013, 05:42

Also you can post here why you dont want to help. ;)
Recommends AHK Studio
User avatar
Grendahl
Posts: 158
Joined: 30 Sep 2013, 08:21

Re: [Help Requested]:Teamwork

04 Nov 2013, 12:34

Because this is posted in the Tutorials forum?
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

04 Nov 2013, 14:27

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.
Recommends AHK Studio
User avatar
Gio
Posts: 299
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Help Requested]:Teamwork

04 Nov 2013, 15:31

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.
"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

07 Nov 2013, 09:03

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.
Recommends AHK Studio
User avatar
joedf
Posts: 6132
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [Help Requested]:Teamwork

07 Nov 2013, 12:40

Can I join? :o
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

07 Nov 2013, 15:38

Yeah everybody is welcome.
Still working on the Docu.
Recommends AHK Studio
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

08 Nov 2013, 09:53

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
Recommends AHK Studio
User avatar
Gio
Posts: 299
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [Help Requested]:Teamwork

13 Nov 2013, 18:15

Still here.
"What is a suitable automation? Whatever saves your day for the greater matters."
Barcoder - Create QR Codes and other Barcodes using only Autohotkey !!
User avatar
joedf
Posts: 6132
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [Help Requested]:Teamwork

13 Nov 2013, 18:33

me too. :)
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

14 Nov 2013, 11:19

OK that's good that was one of the most important parts.
Recommends AHK Studio
Alibaba
Posts: 427
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: [Help Requested]:Teamwork

16 Nov 2013, 05:15

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
"Nothing is quieter than a loaded gun." - Heinrich Heine
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

16 Nov 2013, 09:44

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.
Recommends AHK Studio
User avatar
joedf
Posts: 6132
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: [Help Requested]:Teamwork

16 Nov 2013, 11:00

Graphics engine? SDL? GDI?
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

16 Nov 2013, 16:55

OpenGL
Recommends AHK Studio
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

19 Nov 2013, 12:48

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.
Recommends AHK Studio
Bentschi
Posts: 18
Joined: 02 Oct 2013, 18:45

Re: [Help Requested]:Teamwork

20 Nov 2013, 13:56

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.
User avatar
nnnik
Posts: 2506
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [Help Requested]:Teamwork

21 Nov 2013, 00:59

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.
Recommends AHK Studio

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 5 guests