How to make a infinite backgorund.

Talk about making games.

How to make a infinite backgorund.

Postby mindcontrol » Sun Jun 07, 2015 5:23 pm

Hi, i want to make a Yume nikki's like backgrounds\maps, for who doesn't know, it work in this way: You can go in one direction forever, but at a certain point you find yorself at the beginning (but it seems the map just keep)
mindcontrol
 
Posts: 24
Joined: Sun Apr 26, 2015 12:54 pm
Score: 2 Give a positive score

Re: How to make a infinite backgorund.

Postby koala » Mon Jun 08, 2015 1:05 pm

Place a "Filled Region" at the end of the map. When "Actor" Collides with it, change "Actor's" coordinates. Does this help?
Phascolarctos cinereus
YouTube: Marko Radivojevic
Google+: Marko Radivojevic
User avatar
koala
 
Posts: 301
Joined: Thu Mar 26, 2015 7:03 pm
Location: Serbia
Score: 30 Give a positive score

Re: How to make a infinite backgorund.

Postby MrJolteon » Mon Jun 08, 2015 1:46 pm

Or just make a really long level. And I mean seriously long. So long it wraps around the edge of the 2 000 000x2 000 000 pixel area.

It's probably easier if you listen to koala.
(ninja edit: 2000th post!)
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: How to make a infinite backgorund.

Postby DeltaLeeds » Mon Jun 08, 2015 1:55 pm

If you want the actor to go back to the beginning after a certain limit, like x=9000.
Go to the actor and Draw Actor->Script Editor
Code: Select all
if(x>9000)//Returns the actor to 0 when the actor's x is over 9000, which makes it impossible to go over 9000!!!! (see what I did there?)
{
    x=0;
}
else if(x<0)//Returns the actor to 9000 if the actor's x is less than 0.
{
    x=9000;
}

MrJolteon wrote:ninja edit: 2000th post!

Congratz for 2k posts Jolt!
Currently: Semi-Active.
Working on: Maybe putting my test games in gamejolt, polishing them a bit, but I still don't know when.
User avatar
DeltaLeeds
 
Posts: 693
Joined: Fri May 06, 2011 12:45 pm
Location: In front of my computer.
Score: 38 Give a positive score

Re: How to make a infinite backgorund.

Postby Zivouhr » Tue Jun 09, 2015 1:30 am

Good tips! 8)

For the most accurate transport to any location, I usually use the "Move to" move, instead of the X Y coords.

Move to/Event Actor/Relative to Game Center/Avoid (None)/ Position x 0, y 0 /Velocity: 9999999

or

Code: Select all
MoveTo( "Event Actor", 0.00, 0.00, 9999999.0, "Game Center", "");


In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly. The X, Y position can be seen in the far right side of the top menu panel, to the right of HELP.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: How to make a infinite backgorund.

Postby lcl » Tue Jun 09, 2015 5:33 am

Zivouhr wrote:In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly.

That sounds weird. For me, directly setting an actors x and y coordinates has always worked as it should, and MoveTo has caused issues, because it actually makes the actor travel that distance, not just teleport to the new position. Were you using Activation Regions in that game? Because that's the only reason I'd understand for setting x and y acting weird, I recall something like that happening when I was working with Dimension 55355 and I used Activation Regions. The problem was probably caused by the part of the level not being loaded when I teleported my character there, and when the view actor was also moved there, causing that part of the level to load, the actor would be in a wrong position, if I remember correctly.

Generally I consider it a much better practise to just set the actors x and y, and so teleport the actor to the new position.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: How to make a infinite backgorund.

Postby mindcontrol » Tue Jun 09, 2015 1:43 pm

hmm thanks but it's not what I need, I don't know how to explain it, but seems like the map continue, not like the a 'teleport' wich move you at the beginning.. if you can see yume nikki, you'll understand (the part I mean are the dream's rooms). However between some days i'll try to post a video to explain it.
Ps. I'm not using activation regions, becouse i don't know what they are :D
mindcontrol
 
Posts: 24
Joined: Sun Apr 26, 2015 12:54 pm
Score: 2 Give a positive score

Re: How to make a infinite backgorund.

Postby lcl » Tue Jun 09, 2015 3:22 pm

If you just want to make your background image to loop infinitely, click the open the Actor Control -panel and click the [Normal] button and select Infinite / x Infinite / y Infinite depending on what you want to achieve.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: How to make a infinite backgorund.

Postby mindcontrol » Wed Jun 10, 2015 11:45 am

lcl wrote:If you just want to make your background image to loop infinitely, click the open the Actor Control -panel and click the [Normal] button and select Infinite / x Infinite / y Infinite depending on what you want to achieve.



i already tried, but i have two problems.
1 I should make infinite all the actor, not only the background.
2 I need do make more maps\level, but only one level can be done in this way (becouse it's infinite and ovelay all the GE space)
mindcontrol
 
Posts: 24
Joined: Sun Apr 26, 2015 12:54 pm
Score: 2 Give a positive score

Re: How to make a infinite backgorund.

Postby koala » Wed Jun 10, 2015 12:29 pm

You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").
Phascolarctos cinereus
YouTube: Marko Radivojevic
Google+: Marko Radivojevic
User avatar
koala
 
Posts: 301
Joined: Thu Mar 26, 2015 7:03 pm
Location: Serbia
Score: 30 Give a positive score

Re: How to make a infinite backgorund.

Postby Zivouhr » Thu Jun 11, 2015 12:47 am

lcl wrote:
Zivouhr wrote:In Tomb of Twelve, when I used the X= Y= set up to move the character when a certain event triggered it, sometimes the character would end up in the wrong spot. With the MoveTo code, it solved all the frustration instantly.

That sounds weird. For me, directly setting an actors x and y coordinates has always worked as it should, and MoveTo has caused issues, because it actually makes the actor travel that distance, not just teleport to the new position. Were you using Activation Regions in that game? Because that's the only reason I'd understand for setting x and y acting weird, I recall something like that happening when I was working with Dimension 55355 and I used Activation Regions. The problem was probably caused by the part of the level not being loaded when I teleported my character there, and when the view actor was also moved there, causing that part of the level to load, the actor would be in a wrong position, if I remember correctly.

Generally I consider it a much better practise to just set the actors x and y, and so teleport the actor to the new position.


Thanks. No activation regions only because I had to allow for instant teleportation to any map zone where another warp door was. WIth activation regions, it would be an empty area he'd appear in, so I had to resort to other methods. I was using the X, Y and he'd appear in the wrong spot sometimes, ending up in fatal situations by mistake after losing a life. When I switched to Move To, all those problems disappeared.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: How to make a infinite backgorund.

Postby mindcontrol » Thu Jun 11, 2015 9:05 am

koala wrote:You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").



Seems good, but how to make infinite other actor too (enemy,object,doors ect)?
mindcontrol
 
Posts: 24
Joined: Sun Apr 26, 2015 12:54 pm
Score: 2 Give a positive score

Re: How to make a infinite backgorund.

Postby bat78 » Thu Jun 11, 2015 1:16 pm

mindcontrol wrote:
koala wrote:You can make one .ged file for one level and load that file/level using LoadGame("file_name.ged").



Seems good, but how to make infinite other actor too (enemy,object,doors ect)?


On the same way, make them "x Infinite"

You can constantly create new actors with the CreateActor function.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest