Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Randomly generated content  (Read 2736 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Posted 2005-04-06 09:34:55 »

Continued from here, 'cos it was getting somewhat off-topic.

Summy:
Content creation is hard and time consuming. Randomly generated content trades something I'm bad at - content - for something I'm (supposedly) good at - coding.

Up sides:
Never the same game twice.
Can produce ideas/scenarios that are much more complex or original that you'd have thought up manually.
Do it real-time and get a never-ending game!

Problems:
- How do we make sure that individual levels/etc. are actually fun? (and not just same-y).

- Some styles of game are probably not practical (story heavy games notably).

- Difficulty is tricky to control. Especially making sure you don't suddenly have difficulty spikes because of a certain bad combination of elements.

- Can have a "Played one random dungeon, played 'em all" feel to it. No new surprises, and generally less incentive to go back and see yet another random level.

(todo: back with some actual thoughts later).

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2005-04-06 11:01:51 »

The mini-RPG I'm working on is based on a "card deck" set of rules. You know how in a card game, various cards have various effects but the real complexity arises in the interesting ways they interact, modulate and otherwise change the effects of the other cards in the deck.

Basically that's how the game is designed: I've come up with a deck of 30 odd "things" that have various effects on each other, and your game, designed to last for 5 minutes, is basically dealt a hand of 10 of those. So in one game we've got the Dark Lord and the One Ring and an earthquake; in another game you've got the Goblin,the Sword of Many Small Accidents, and the Potion of Stupidity. By keeping a limit on the number of things I can work on ways to make them all interact with each other in amusing ways.

nethack does this but on such a hugely grand scale you pretty much have to play it for years to see it all and there's basically no hope of ever "winning" which kind of grates after a while.

That's the theory anyway.

Cas Smiley

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2005-04-06 11:31:25 »

That would be an interesting method, one thing that always confuses the heck out of me in Bauders Gate etc. is when you end up having multiple, conflicting side effects via combinations of items, spells, modifiers etc. I expect with the large amount of items and such they have some horrible spaghetti code full of exceptions and special cases.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #3 - Posted 2005-04-06 11:41:57 »

I find randomly generated content very interesting, and have spent a lot of time trying to figure it out.
Some unconnected and random thoughts:

The success of random content really depends on what the purpose of the game is and how the randomness is used.
Random levels are fine if the purpose of the game isn't to beat the levels. For example, random levels are fine in Civilization and XCom, but they would suck in Super Mario Brothers and pinball games.

Until we have proper AI's, I think using pre-defined building-blocks (kinda like what princec said) will be your best bet for a good mix between random content and interesting gameplay.
Good examples of this are the area blocks in X-Com, and the monster vaults in ADOM.

Run some kind of sanity check on your randomly generated content after it's been generated. Reject and re-generate maps that happen to be totally void of resources. Don't accept random names that happen to spell out profanities.

Pseudo-random content is also very interesting. Have a single fixed seed for your game, but generate all locations on the fly. That gives an infinitly large world that is the same for all players.

Play Minecraft!
Offline Bombadil

Senior Member





« Reply #4 - Posted 2005-04-06 12:09:43 »

Do you remember the great game named Elite by Braben and Bell. They used some "kind of randomly generated" star maps with all those many planets, but their system made the names not to sound too odd.
Okay, that's some decades old but still comes to my mind when I read your interesting thread here. :-)
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2005-04-06 12:36:27 »

My current project is a top-down scrolly shooter in the style of gigawing or guwage, and the random content idea effectivly grew from PlasmaZone.

What PlasmaZone did quite well (IMHO) was generating levels that were suitable different and managing to have an increasing difficulty level (even if it was a bit steep). There I basically had a set of templates in the form of 'waves'. Each wave could then be created with a difficulty level. Then I applied geometrical transforms (mirror, flip, rotate - also picked at random) to generate pairs or groups of waves. The templates mean you get interesting forms, and the addition of the duplicate-and-transform means you get a certain symmetry or coordination that makes it look more human-created than just arbitrary wave after wave. After the first few levels it starts running more than one wave-group at a time, so it really gets intense.

I'm expecting something similar with my shooty game. Essencially similar to Cas' method - a collection of user created content (in this case, enemies, paths, heightmaps, bullet waves) but spliced together in random ways. Unlike Cas I hope that I won't have to engineer specific interactions - just the attempt to dodge/shoot/collect the ever changing combination should provide enough variety.

My current snag is making sure that it physically hangs together well (i.e. not looking like a bunch of random elements). I will probably re-use the idea of duplicating and transforming certain things. But bits like ground terrain need some kind of stitching together, and you need to prevent silly stuff like everything clumping in one corner. I suspect I might need some kind of (user-specified) restrictions on which bits of generated content can happily co-exist with others.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #6 - Posted 2005-04-06 13:30:00 »

in my shooter I use some user defined events like bosses or powerups plus something like "foeSpawnerPlugins" and "BoringWatchers" which spawn random things with a fixed seed value. So each time you play most formations come from the same spot.
I let the autopilot fly through all levels (over night), tracking stats like foeCount, enemyFireCount, missedFoes, energy, points, money,...
The next morning I look at the curves and instantly see at which point there is too much action or points where the autopilot gets killed everytime.
Next step will be that the autopilot changes those points automatically (and improve the autopilot by mutation).
Glad that coding a cpu player for a topdown scroller is easier than for a strategy game or Mario.
The levels in my game still suck  :-/  but hopefully that'll change soon, with very litlle effort per level)

lots of sillystupid games: http://www.emaggame.com
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2005-04-06 14:11:16 »

Interesting approach, but I'm aiming at random generation on-the-fly so not really practical for me unfortunatly. Although perhaps I could use something similar to fine-tune the level generation (its basically a genetic algorithm you're going for there, and they're pretty easy to get good results from).

Slightly OT, but how does your player AI actually behave? I'd like to do something similar, but have no idea where to start...

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #8 - Posted 2005-04-06 14:47:57 »

Quote
Slightly OT, but how does your player AI actually behave? I'd like to do something similar, but have no idea where to start...


Just some simple rules. For steering the ai uses keyPresses, so each maneuver is possible for a human player. Instead of explaining the rules I post the code.
!BEWARE OF BAD CODING STYLE AND UGLY FORMATING!
(sorry, I'm just too lazy to make it nicer now)
Because you opened this thread and asked for it, everybody else should shut both eyes and scroll down Grin

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
public class AutoPilot
    extends KClass {

  private Ship ship;
  private GameEngine g;

  public AutoPilot(Ship ship) {
    this.ship = ship;
    this.g = ship.g;
  }

  public void steer() {
    Key.setPressed(Key.LEFT, false);
    Key.setPressed(Key.RIGHT, false);
    Key.setPressed(Key.UP, false);
    Key.setPressed(Key.DOWN, false);

    if (foes()) {
      ship.fire();
    }

    headFor(new V2(ship.startx, g.now.y + .25));

    FoeFire ff = (FoeFire) g.ym.foeFire.getClosestYop(ship);

    if (ff != null) {
      float dist = ff.dist(ship);
      //if(dist<.03f)ship.pod.fireByName(Lang.SmartSuperCluster);
     if (dist < .04f && ship.shield < 2) { //@todo: richtung ber├╝cksichtigen
       if (ship.hp / ship.hpMax < .1 && ship.hasShieldLeft()) {
          ship.fireShield();
        }
        else {
          headAwayFrom(ff);
        }
        return;
      }
    }

    if (ship.foesInNegTractorbeamRange > 10) {
      fireSpecial();
    }
    Foe nf = (Foe) g.ym.foes.getClosestYop(ship);
    if (nf != null) {
      float dist = nf.dist(ship);
      if (dist < .08f && ship.shield < 2) {
        headAwayFrom(nf);
        if (dist < .04f) {
          fireSpecial();
        }
        return;
      }
    }

    Yop p = nearestPow();
    if (p != null) {
      //Foe f=Yop.closestFoe(p);if(f!=null && p.pos.dist(f.pos)<.13f) return;
     if (p.name.equalsIgnoreCase(Lang.YSHOP) && ship.money < 800) {
        return;
      }
      headFor(p);
      return;
    }

    if (foes()) {
      Foe f = Yop.closestFoe(ship);

      if (f != null) {
        float dist = f.pos.y - g.now.y - f.getRadius();
        if (dist > .3f && ship.pos.y < f.pos.y) {
          headFor(f.pos.addN(0, -.3f));
        }
      }
//if(Ma.wave(4f)>0){Key.setPressed(Key.LEFT,true);Key.setPressed(Key.RIGHT,false);}else {Key.setPressed(Key.RIGHT,true);Key.setPressed(Key.LEFT,false);}

    }
  }

  boolean foes() {
    return g.ym.foes.size() > 0 || g.ym.foesGround.size() > 0;
  }

  Yop nearestPow() {
    return g.ym.powerUps.getClosestYop(ship);
  }

  void headFor(V2 v) {
    ship.headFor(v);
  }

  void headFor(Yop o) {
    V2 v = new V2(o.pos);
    headFor(v);
  }

  void headAwayFrom(Yop o) {
    headAwayFrom(o.pos);
  }

  void headAwayFrom(V2 v) {
    V2 pos = ship.pos;

    //Yop.getAngle()
   Key.setPressed(ship.bright(), v.x < pos.x);
    Key.setPressed(ship.bleft(), v.x > pos.x);
    Key.setPressed(ship.bup(), v.y < pos.y);
    Key.setPressed(ship.bdown(), v.y > pos.y);
  }

  float lastspecial;

  void fireSpecial() {
    if (ship.pod.getSpecials().size() == 0) {
      return;
    }

    float n = g.ym.foes.size() + g.ym.foesGround.size();
    n /= ship.pod.getFirepower() * 15f;
    n /= (float) ship.hp / ship.hpMax;
    M.log.warning(this, "prob=" + n);
    if (!Ma.prob(n)) {
      return;
    }
    if (g.time() - lastspecial < 1f) {
      return;
    }
    ship.fireSpecial();
    lastspecial = g.time();
  }

}


the logger for the stats runs in an extra thread and makes a snapshot every second...

lots of sillystupid games: http://www.emaggame.com
Offline CaffeineOverdose

Senior Newbie




Java games rock!


« Reply #9 - Posted 2005-04-06 21:47:21 »

Quote
Don't accept random names that happen to spell out profanities.


You should should have told this to the people at Matel (I think it's Matel) who make Cabbage Pach Dolls. When you buy one it has a randomly generated adoption number (a string 6 chracters long (well actually 4 characters a dash then two more characters) of up upper case letters and numbers). One girl got a Cabbage Pach Doll with the adoption number of f**k-ME.

Sorry, this dosn't really ralte to the thread but I thought it was an interesting story to share and to keep in mind whenever you are generating random names.

Another huge advantage in randomly generated content is to prevent people playing the game from using player guides. If randomly generated content is correctly implemented a player guide should become useless.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 14
Projects: 19


Mojang Specifications


« Reply #10 - Posted 2005-04-07 06:23:46 »

Oh, I disagree. I've use the guidebooks for nethack and adom to make both games quite a lot easier.

Play Minecraft!
Offline Breakfast

Senior Member




for great justice!


« Reply #11 - Posted 2005-04-07 16:15:25 »

In the future games will be written in which everything is randomly generated...

That's maybe the distant future but as we get better processors and better understanding of AI it seems to me that this will be the way forward, especially for freeform rpgs, traders and rts games.

As graphics cards improve it will become exponentially harder and more time consuming to make your models by hand so we can expect much more in the way of terrain and scenery-generating middleware over the next few years. It's not genuinely "random" in that you're setting constraints on what objects can happen where in the world but it counts as automatically generated content at least.

I don't see why in the longer term it won't be possible to use more advanced AI to build economic systems and ecosystems that can be used to generate their own plot lines as the game plays out. The edge benefit to this is that the game becomes truly interactive because the world AI can react to the player's actions without having to resort to a limited set of scripted possibilities. I would be surprised if we saw this happen within the next 10 years, however...
Offline winkman

Senior Newbie




Java games !


« Reply #12 - Posted 2005-05-17 13:28:49 »

I remember having seen some tuts on randomly generated content on gamasutra.com
(including random name generation)
... but cant remember the exact article
Offline Breakfast

Senior Member




for great justice!


« Reply #13 - Posted 2005-05-17 19:46:16 »

This uses a lot of  randomness and if it fulfuls half of it's potential it could just prove to be utterly fantastic...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (13 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!