Intrested to boost GLBasic to a full game engine/library?

Previous topic - Next topic

Foo

Yes, I now. But if the ALIAS works as a pointer, there would be no problem.

And to prevent performance issues and other things I need a pointer.

Imagine all[] contains all current game objects - lets say 10.000
But some operations are made only with the object_type = "b"
If there are 6000 object_type = "a" objects and 4000 object_type = "b" in the list. I have to do 6000 useless loops and if statements.

Hemlos

From my experience with arays, it would be best to only use 1 dimensional arrays with 1 type of object to be processed.

Split it into 2 arrays.

I used dozens of arrays together to accomplish getting rid of redundant memory slots.

Is this way not efficient to do?

Bing ChatGpt is pretty smart :O

Kitty Hello

Code (glbasic) Select

typeAList[0] = Aa
typeAList[1] = Aa2

typeBList[0] = Ab
typeBList[1] = Ab2

No, sorry - here you're doing a copy assignment.

You want to store a list of pointers to objects in another list. That's not possible. Redesign your application, I bet there's another way t do it instead.



Foo

QuoteSplit it into 2 arrays.
As you can see in my example thats not possible.
But we are running now in a situation, what we call in Germany: "Verzetteln" :)

@Kitty
Is it possible to implement that pointer thing?
I am a software developer mainly web applications and Java desktop apps - so that I know that referencing types (objects) are the right thing.
If you say: "Sorry, thats not possible - okay, then I must find an another solution for that problem."
But if you say: "Okay, thats possible, but requires... or it can't be done until I...." Alright, then I know don't have to touch my design, or something like that.

For instance, if I can work with pointers. Nearly every design pattern is possible. For example: Observer, Proxy, Plugin...

Kuron

Just to back up the original post, there is no problem making a Game Maker type of product.  I have two different games that include a custom scripting language.  The games can be "modded" or new standalone games can be made to share with others.

Kitty Hello

There's 2 possibilities for your problem.
a) (nice one) keep a list of indices for the objects you need in A
Code (glbasic) Select

LOCAL indA%[]
DIMDATA indA%[], 5,7,2234
FOREACH id% IN indA%[]
   ALIAS obj AS gObjects[id%]
   obj...
NEXT


b) (bad kitty, bad) Use INLINE to get your pointers.
Code (glbasic) Select

INLINE
DGArray<MyType*> ptrs;
DIMPUSH(ptrs, &obj(123) );

for(int i=0; i<LEN(ptrs); ++i)
{
   ptrs(i) -> DoSomething...
}


Really - go the first route.


Foo

Quote from: Kuron on 2009-Oct-15
Just to back up the original post, there is no problem making a Game Maker type of product.  I have two different games that include a custom scripting language.  The games can be "modded" or new standalone games can be made to share with others.
Thats nice :) Interested to share your thoughts and experience? In a few days I'll be releasing (so I hope) a first alpha version of my GML inspiered thing, hmm I think you can call it something like a GLBasic framework. I was able to implement the object concept including the event system from GM.

At the moment you can use the following events:

  • draw
  • collision (half finished)
  • step
  • begin step
  • end step
  • keyboard
  • mouse
At the object behavior site its possible to use the following attributes with functions:
object_id, x, y, direction, speed, move_to_point (isMoving),
There are some movement functions like move_to_point and move (by direction and speed) too.
Plus a few functions for draw and sound.


@Hello Kitty
Thanks for the code - may be I can do what I need with that :)
What language did you choose to create the GLBasic IDE?
I was thinking about the GUI possibilities of my idea...



Kitty Hello

I use C++ / MFC for the GUI, because that's what I use at work and know most about.

Foo

Thanks for the info - first I thought it was build with Delphi....  =D
So its C++ what you use for the IDE too. BTW: Do you think its possible to use regular expressions easily with inline?

Kuron

QuoteInterested to share your thoughts and experience?

I am not well-liked around here, so I rarely post  anymore  ;)

Kitty Hello

the IDE is MS Visual Studio, the best IDE ever (if you disagree, you propably have not used it before). But it's not very cheap.

We're working on regexp, but there seems to be a problem with the output, still.

Ian Price

Visual Studio (and extras) was available for free at one point from Microsoft - I don't know if it still is. I used the Enterprise Edition many, many moons ago and thought it was pretty good, although my experience of devving in C++ was pretty limited at the time (even less now!).
I came. I saw. I played.

Foo

Hello,

the project process continues :)

Added the full event concept - a lot of them are triggerd @see first post.