Luck elimination methods

In my endless runner game,hurdles and boosters are randomly generated.But this introduces luck. sometimes it is easy to play and sometimes it is not.How to avoid the luck?

i thought of something like below

local boosters={1,2,3,4,5,6,7,2,3,1,6,7,1,5,6,8,6,4,2,3} local c=1 function createBooster(i) c=c+1 --create the booster based on "i" if i==1 create booster 1..blah blah.. ​end end createBooster(boosters[c]) --call createBooster on regular time intervals --since each booster is predefined,no luck happens --By changing the positions of elements "boosters" array,monotonocity will be avoided

How you guys actually avoid luck?

Please share some algorithms and if possible sample codes…

Hey…Someone reply

Patience! :slight_smile:

You do realise for most people on this board it’s the middle of the night, and if not, barely after breakfast!

ok!

if you remove luck the game will boring like hell. by your comment, I can conclude that your random variables have a bigger range than they should.

Do you have levels? for example: randomObj=math.rand(lvl*1, lvl*10) it will show more objects harder the level. if its time-based game…the longer the game the more objects you can create with the same approach. if it’s both you can join both formulas.

if you want to remove lucky, maybe a multi-dimension table with the quantities/time is a way to go. that way when you hit X seconds you will get Y objects…you can have a random number with a lower ranger to the return value so you can have a controlled random number. 

local showObjects={{5, 3, 7, 10}, {10, 7, 13, 5}, {4, 2, 6, 3}} -- {objects, random range\_min, random\_range\_max, time passed} local rand=math.random local round=math.round local myListener = function( event ) local timer=round(event.time\*0.001) for i=#showObjects, 1, -1 do if showObjects[i][4]==timer then print ("timed passed: "..timer..", creating "..showObjects[i][1].." objects - fixed approach") print ("timed passed: "..timer..", creating "..rand(showObjects[i][2], showObjects[i][3]).." controled random objects approach") showObjects[#showObjects]=nil break end end end Runtime:addEventListener( "enterFrame", myListener )

this will provide fixed and controlled random objects at specific time, but you can also add some controlled random time with little changes.

I doubt this is a good approach because the larger the array the slower the game will be, it surelly needs some more thought how to make it in a real game scenario. But i hope you get the idea. Please note, I never made a runner game, just made this in my lunchtime :wink:

another approach:

local objects={"object 1", "object 2", "object 3"} local random\_time\_start=1 local random\_time\_intervale=5 local random\_time\_range=2 local round=math.round local rand=math.random local function showObject(timer) local pick\_object=rand(#objects) print ("seconds passed: "..timer.."\n"..objects[pick\_object]) end local myListener = function( event ) local timer=round(event.time\*0.001) if timer\>random\_time\_start then random\_time\_start=random\_time\_start+rand(random\_time\_intervale-random\_time\_range, random\_time\_intervale-random\_time\_range) showObject(timer) end end Runtime:addEventListener( "enterFrame", myListener )

But games like candycrush have great mechanisms that avoid luck.no?

on the one end:  purely random distribution (lots of games work like this)

on the other end:  entirely predefined distribution (lots of games work like this)

in the middle, lots of room for various hybrid approaches (lots of games work like this)

the point is:  there is no one right way to do it, and only YOU know what will “feel right” for your game.

maybe a weighted distribution, or heuristics based on recently-generated items, or etc

a common solution is:  a random distribution, but of longer predefined segments (lots of games work like this)

Tip:   The actual topic here is ‘chance’ not luck.  Try looking up articles on ‘modifying chance in games’ and you’ll find all kinds of good reads on the topic.  

http://www.acagamic.com/courses/infr1330-2014/chance-and-skill-in-game-design/

Then when you find an algorithm and/or technique you want to implement you can ask us about it if you get stuck.

To avoid luck and have a random game. You can do something like this:

x=RandomValue(0,1) nextRandomValue=1-x+randomValue(0,1)

Like this, not luck and random. If you are luck once, the next time you wont be lucky.

Try to adapt the game to the player. Have a look on his average score, highest score…and then adapt the “luck” to the player.

A new player need to have a easy game and advance one need challenge.

If a player don’t play to your game for more than two days let him do a new high score…

my opinion was based on your game type only (runner game). I’m imagining a game like flappy birds or a hero jumping buildings without random events would be very boring…and that was my opinion nothing more :). you can’t  put all games in the same boat…and compare them. A candyCrush type vs a Tetris type. Imagine playing Tetris with the same approach as Candy…all games with the same pieces.

you need to figure it out what’s the best for your needs and what experience you want to give for the players.

you’re the one doing the game, you do what you want :slight_smile:

Sid Meier -> respect …good times :slight_smile:

All answers are great. So I don’t know which one to “mark solved”.I am gonna try all the methods.Thanks to all…!

That post is great.Some good lines:

  • The game provides meaningful choices. Several strategies can allow the player to win. There is no dominant winning strategy in the game.
  • Chance does not play a role so great that player skill is irrelevant. A player with more skill should be more successful than a poor player.
  • The game’s level of difficulty should be consistent. The players perceive the challenges in the game as not abrupt and within a reasonable range of their abilities

On why a game should not be based only on skill:

  • One of your players beats all the other players by a wide margin. This could be an indicator that your game is heavily skill-based and one player has mastered this skill. To keep a game balanced for players with different skill levels, it is important to add some elements of luck to it.

Hey…Someone reply

Patience! :slight_smile:

You do realise for most people on this board it’s the middle of the night, and if not, barely after breakfast!

ok!

if you remove luck the game will boring like hell. by your comment, I can conclude that your random variables have a bigger range than they should.

Do you have levels? for example: randomObj=math.rand(lvl*1, lvl*10) it will show more objects harder the level. if its time-based game…the longer the game the more objects you can create with the same approach. if it’s both you can join both formulas.

if you want to remove lucky, maybe a multi-dimension table with the quantities/time is a way to go. that way when you hit X seconds you will get Y objects…you can have a random number with a lower ranger to the return value so you can have a controlled random number. 

local showObjects={{5, 3, 7, 10}, {10, 7, 13, 5}, {4, 2, 6, 3}} -- {objects, random range\_min, random\_range\_max, time passed} local rand=math.random local round=math.round local myListener = function( event ) local timer=round(event.time\*0.001) for i=#showObjects, 1, -1 do if showObjects[i][4]==timer then print ("timed passed: "..timer..", creating "..showObjects[i][1].." objects - fixed approach") print ("timed passed: "..timer..", creating "..rand(showObjects[i][2], showObjects[i][3]).." controled random objects approach") showObjects[#showObjects]=nil break end end end Runtime:addEventListener( "enterFrame", myListener )

this will provide fixed and controlled random objects at specific time, but you can also add some controlled random time with little changes.

I doubt this is a good approach because the larger the array the slower the game will be, it surelly needs some more thought how to make it in a real game scenario. But i hope you get the idea. Please note, I never made a runner game, just made this in my lunchtime :wink:

another approach:

local objects={"object 1", "object 2", "object 3"} local random\_time\_start=1 local random\_time\_intervale=5 local random\_time\_range=2 local round=math.round local rand=math.random local function showObject(timer) local pick\_object=rand(#objects) print ("seconds passed: "..timer.."\n"..objects[pick\_object]) end local myListener = function( event ) local timer=round(event.time\*0.001) if timer\>random\_time\_start then random\_time\_start=random\_time\_start+rand(random\_time\_intervale-random\_time\_range, random\_time\_intervale-random\_time\_range) showObject(timer) end end Runtime:addEventListener( "enterFrame", myListener )

But games like candycrush have great mechanisms that avoid luck.no?