GoldSpace (Working title: Space Pirate)

Bombini

  • *
  • Posts: 1400
Very good point!
Thanks...i will include an select option on start to swap the controls.
The game autosaves when you have en encounter with an enemy ship.
I will make that more prominent but it works already.

Stay tuned for a cleaned up version next week.
Cheers!

ETHproductions

  • *
  • Posts: 430
I started looking into custom events some days ago but i am not sure if i understood 100%. Maybe you can help. I have a lot of systems in Space Pirate that kind of needs "always" or atleast "every x seconds".

Examples:
  • A terminal which checks if the actor is still touching it
  • An enemy that needs to check where the player is and adjust its state
  • Spreading fire (which checks where it could spread to next)
I understand how i setup custom events but i am not sure how that would save performance.

Lets stick to example 2:
Would it save performance if i put the "trigger custom event block" into "always/every x second" and the whole function into the custom events instead of having the whole thing in the  "always/every x second"?

I've realized since last night that custom events aren't always the best solution. Most of the time, the code only needs to be run under one condition, so placing it inside an if (that condition is true) is a better choice.

Custom events don't save performance if they are executed every frame, as the game is still running all of the code 100 times/second. However, most of these tasks can be executed inside an "if" block which checks if the code needs to run. Let's take a look at your examples:

1. The player-checking code could be placed inside an if (any of the player-moving keys are down AND the player was previously touching the terminal). That way, the code is only run when it needs to, which will save on performance.  As the code only needs to run under one condition, it wouldn't necessarily be faster if put inside a custom event.

2. As the enemy would be constantly moving, AI things like this would probably be best in an Always event. If you want to save more on performance, you could consider using "do every 0.1 seconds", or something similar.

3. I don't believe this should happen 100 times/second, but it is a fairly regular task, so it would work best in a "do every X seconds" block. I assume that is what you have set up already.

So basically, the best way to accomplish these tasks depends on the situation. I see now that custom events aren't normally the best way; placing the code inside if (this code needs to be run) works just as well.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Bombini

  • *
  • Posts: 1400
This very interesting and helpful. Thanks!"
Just to make sure i understood you 100%:
Quote
Most of the time, the code only needs to be run under one condition, so placing it inside an if (that condition is true) is a better choice.
This means that an "if" check inside an "always" runs the always but not the code under "if" if the condition is not true right?
Using an "every x second" instead "always" obviously saves performance.
This would  mean ihat it doenst matter how much code i put into a behaviour if i sort it the right way and let not all activate the same time.
Correct?

Btw...a custom block runs only once when its triggered or? If thats true it should save performance as the "always" runs so many times per second. Not sure ;)


ETHproductions

  • *
  • Posts: 430
Just to make sure i understood you 100%:
Quote
Most of the time, the code only needs to be run under one condition, so placing it inside an if (that condition is true) is a better choice.
This means that an "if" check inside an "always" runs the always but not the code under "if" if the condition is not true right?

Yep, you got it!

This would mean that it doesn't matter how much code i put into a behaviour if i sort it the right way and let not all activate the same time.
Correct?

Right again! Although the more code you have in your behavior, the longer it takes to compile.

Btw...a custom block runs only once when its triggered or? If that's true it should save performance as the "always" runs so many times per second. Not sure ;)

Did you mean a custom event? Custom events do run only once when triggered, but triggering them in an Always event has exactly the same result as placing the blocks from the custom event inside the Always event. In other words, they don't really save on performance unless they aren't activated every frame.
Fontstruct - Stencyl - Website (in progress)

Proud Member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Bombini

  • *
  • Posts: 1400
Thanks a lot! Realy!
This helps a lot!
Cheers

Bombini

  • *
  • Posts: 1400
I am working on a very polished PC/MAC build for next week.
A lot of performance issues fixed, enemies advanced, levels a bit polished and effetcs added.
I am polishing the gameplay on the starmep. Adding random loot and specifying the space traffic a bit better.
Very excited about this!

I am working on thinner walls for rooms which can be blown up.
And there is one more thing.

I always wondered how i would handle some sort of randomly generated content.
It is needed because for the universe because i dont want to have the same experience over and over again even if there are a lot different ships to loot. I wont use procedual generated levels because i dont know how to do that and i dont know if i would have as much details as i have now in the levels. One idea that i have is "random events".

Random events can occur with a certain percentage when you loot a ship. This could be other pirates attacking, a meteor crashing into the ship and much more. I am experimenting right now with that.

Meteor crashing into ship and spawing alien eggs:





koopke

  • Posts: 51
randomness can be awesome idea to add to this game.

I ran into some new bug (not sure if you fixed it already. at some point when flying in space my ship was disappeard . if I press some keys I can see the other (green) ships moving around and everything fine except my ship is no longer around.


1MrPaul1

  • *
  • Posts: 1285
Your game with shadows looks better.

Performance issues can occur when you send some message to the all behaviors of some actors.
Also, game looks freezing because of moving stars at the back.
try to use Rob's smooth motion behavior for the stars.

May be to make round collision shape for you hero, probably with round shape will be easy to moving.

Flying on the ship is very buggy, very often I closed the game because ship just stops  and I do not knew what to do.

Also, you need to add exit button and some menu for save etc.


Bombini

  • *
  • Posts: 1400
Thanks a lot guys!

Some comments:
I ran into some new bug (not sure if you fixed it already. at some point when flying in space my ship was disappeard . if I press some keys I can see the other (green) ships moving around and everything fine except my ship is no longer around.
Let me know if you can be more specific but i will look into it anyways
Your game with shadows looks better.
Thats what most of the testers say as well. I will polish the game more and then very likely add those.
Performance issues can occur when you send some message to the all behaviors of some actors.
Also, game looks freezing because of moving stars at the back.
try to use Rob's smooth motion behavior for the stars.
I will look into it. The stars are actually background layers.
May be to make round collision shape for you hero, probably with round shape will be easy to moving.
It is already round but i will improve that topic
Flying on the ship is very buggy, very often I closed the game because ship just stops  and I do not knew what to do.
Again, it would be very helpful to make a screenshot or give me some more details because i dont have that (only when fuel is empty and ship blows up)

Also, you need to add exit button and some menu for save etc.
Totally agree ;)

« Last Edit: June 08, 2015, 04:16:20 am by Bombini »

1MrPaul1

  • *
  • Posts: 1285
Probably in my case spaceship got to blows up and reload the game but it is not happen

If it is already rounded why it stacked on the corners... strange, may be to make diameter smaller? 

I know that this is background layer but why not to make it as simple actors? There is no difference except when it is regular actor you have more control on it. try to add smooth motion. It is very important because when fps lower than 60 jerky motion of the stars makes an illusion that your game is lagging

Bombini

  • *
  • Posts: 1400
Thanks a lot!
This very helpful and i will work on it.

Bombini

  • *
  • Posts: 1400
hi guys,

i will be on a planned longer "Space Pirate break" starting next week.
I will be start working on it again around the 20th of july.

The plan is unchanged to release the game end of this year and i will get full force back to it.
Meanwhile enjoy one more character from the communication screen:



Cheers!

rrzl

  • Posts: 242
New art style? Nice color palette on this one.

Bombini

  • *
  • Posts: 1400
New art style? Nice color palette on this one.

Its using the same resolution as the game but i wanted to give the enemies more flavour when you talk to them.
I will adjust the palette of the game to have a better fit.

yoplalala

  • *
  • Posts: 1632
I think you must give the possibility to change the controls for moving and shooting. I tried to play it but I have azerty keyboard, so I stopped instantly :(