how can I do this?

Non-platform specific questions.

how can I do this?

Postby Hblade » Tue Jul 31, 2012 1:16 am

I'm on a goal to figure out programming from a different view. My goal is to not use if statements and still be able to make a decent game. Currently Im trying to figure out something like this:

Code: Select all
if(yvelocity>2)
{
//code)
}


since you can't use > and < in case: codes
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: how can I do this?

Postby AliceXIII » Tue Jul 31, 2012 2:26 am

this is exactly what i've been trying to do myself, although some if's will need to exist..

your best bet at optimization is to use pointers and send activation events, since pointers use only 2 bytes of data and activation events can be used sorta like inheritance but on a specific level for instance:
optimization.zip
(451.35 KiB) Downloaded 108 times


if you check that out i was trying to make a way to take advantage of one draw_from() function to draw a tiled out map from a single actor onto a canvas would have been something great had it worked but the only trouble is getting the animpos to change then be drawn only for the single instance of a tile which i've only gotten to work once..

this may seem off topic but i posted it because this is a good example of using SendActivation() for optimization which optimization is what im guessing your going for :)
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: how can I do this?

Postby Hblade » Fri Aug 03, 2012 4:23 am

I like the file you just gave. Its actually put together really well =)
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: how can I do this?

Postby AliceXIII » Fri Aug 03, 2012 1:43 pm

I try my best to program, and piece together my programs in the most optimized way which is why i still have tons of work on my engine i started it before i knew alot of stuff i do now so alot of reworking to be done..

The idea was to show you that although if's are nasty they hold there specific place for use, when needed they should be used on inherited actors or sent by send activation events so you keep the calls down to a minimum and so you only need to write your if a single time!

this specific example i made in a minute or two trying to find a way to make static maps load from a single actor with a single canvas if your interested as am i, im still working on a way to make it work :)

also instead of draw actor's if you can use send activation events use them saves alot of calls, my engine total i think a single actor has a draw event and that's just my debug text actor every other actor uses send activation although i need to rework some to use inheritance instead of activations!

maybe i should make a tutorial on inheritance, send activation's, and pointers after all they are the way GE was meant to be used! :P
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: how can I do this?

Postby Hblade » Fri Aug 03, 2012 11:15 pm

A whole map on a single canvas would be fascinating!
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: how can I do this?

Postby AliceXIII » Sat Aug 04, 2012 12:11 am

fascinating and very hard :lol:

maybe even impossible to do it with a single tile actor im thinking you would need to use a single actor for every differn't tile animation there is and save there map animation and x and y externally then read it in and draw it would still be more optimized than having 1000+ actual actors existing though, but not as nearly elegant as the first proposed idea..
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: how can I do this?

Postby Hblade » Sat Aug 04, 2012 6:32 am

Whewww o-o'
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: how can I do this?

Postby AliceXIII » Sat Aug 04, 2012 7:45 am

I got all the resources to do it just need to put it together :wink:
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron