Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Random Generator
- GoldenTaile
- Scratcher
15 posts
Random Generator
Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
- footsocktoe
- Scratcher
1000+ posts
Random Generator
Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
You can't make a truly “infinite” anything, but you can easily create a “never ending” scroller just by having it loop back to the beginning when it runs out of things to scroll to.
Here is a simple “infinite” scroll of stars, for example…
https://scratch.mit.edu/projects/94158196/
SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!
- zp100
- Scratcher
100+ posts
Random Generator
There's no way to make it infinite without repeating stuff (like using clones). To do that would take an infinite amount of code. But, like footsocktoe said, you can make it loop around again so that it repeats forever. Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
Logic will get you from A to B. Imagination will take you everywhere.
- Albert Einstein
- TheLogFather
- Scratcher
1000+ posts
Random Generator
It really depends what you mean… Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
Do you want to be able to move around in a world that gets generated as you move through it, but which also ‘remembers’ what was ‘behind’ you (so you see the same thing again if you go back there)?
Or will it be just scrolling in one direction? (So it doesn't matter about regenerating what was ‘behind’, since you'll never go back there.)
If you want the second case, it's easy (just pick random all the time to generate things as you go forward, and you're done – just like footsocktoe's example above).
But if you want the first then you have to use a pseudorandom number generator (pRNG) that can take a ‘seed value’ as the basis for creating (and recreating) a chunk of the world as you move (back) into it. Each chunk can be completely regenerated from just its seed value alone, and you could assign the seed value for each chunk based on its position in a very large 2d grid, for example.
A pRNG will eventually repeat (since you have a finite number of possible seeds), but you can have a pRNG with a large enough cycle that, in practice it'll not actually happen.
For example, I have a couple of shorter-period pRNGs in this project which would allow to you have a 2d grid of more than 60000 x 60000 distinct chunks of world – so you'd have to cross 60000 chunks in one direction before it repeats. That should be fine, in practice. (If your world is a side-scroller, then it's essentially only a 1d grid of world-chunks, in which case it's four billion before it repeats.)
However, if you're actually in *full* 3d (i.e. you can move in all three directions any distance, so in space, I guess) then it's more like 1500 x 1500 x 1500 chunks of world (i.e. sets of star positions, and other objects, in each chunk), and it seems like it could be possible to cross 1500 chunks in one direction during a game, in which case they will start seeing a repeat. So it'd be better to have a much longer-period pRNG for that (which I have in the same project, and which would allow a 3d world which would be over two million chunks across in each direction).
Hope that makes some sense somewhere!
BTW, I'm not sure where the “clones” part of the question comes into it – I don't see that it makes any difference whether or not it uses clones. What is it you're thinking about that…?
Last edited by TheLogFather (April 11, 2016 08:41:53)
Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- enderdragon6683
- Scratcher
98 posts
Random Generator
I have something similar here but it is only one screen. The way it works, however may allow for scrolling.
go
go
go to [https://scratch.mit.edu/projects/104165532/]
when I receive [Bored]
go to [Online RPG]
say [I'm not bored!]
set [fun] to [Infinity]
Go to the Online RPG
- gtoal
- Scratcher
1000+ posts
Random Generator
basic principle explained here: Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.https://scratch.mit.edu/projects/102145767/
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
- B1battledroid98
- Scratcher
1 post
Random Generator
There's no way to make it infinite without repeating stuff (like using clones). To do that would take an infinite amount of code. But, like footsocktoe said, you can make it loop around again so that it repeats forever. Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
- ab9130
- Scratcher
100+ posts
Random Generator
Do not post on old topics. It is a form of spam.There's no way to make it infinite without repeating stuff (like using clones). To do that would take an infinite amount of code. But, like footsocktoe said, you can make it loop around again so that it repeats forever. Hey guys I'm making an Random World Generator for my game Scratch craft, you can check out the prototype in my profile.
Anyways, I was wondering if it's possible to make an infinite scroller without using clones.
I want this game to be TRULY INFINITE, however if this isn't possible I will just create an really BIG world generator.
If it is possible to make an infinite scroller without clones then please tell me how.
- Discussion Forums
- » Help with Scripts
- » Random Generator