Jump to content
Pericolos0

procedural FPS

Recommended Posts

edit: whoa.. 6000 pageviews? Did this thread get linked somewhere? :P

Yep !

On Nofrag.com (french community about FPS game) by example.

We love your project peri ! :)

Share this post


Link to post
Share on other sites

What tools are you used for creating this ?

I also play around with procedural games. Atm I am trying to make a topdown RPG.

If you want any help/sparring, let me know, would find it very interesting.

Share this post


Link to post
Share on other sites

I'm noticing that the unity web player stutters a lot when I try to open the game (it crashes chrome if i'm not viewing the game while it loads as well), which leads me to think that you are doing all your procedural generation in the onstart method and not in a coroutine.

public void onstart()

{

StartCoroutine(GenerateLevel());

}

public IEnumerator GenerateLevel()

{

GenerateABlock();

yield return new WaitForEndOfFrame(); //or something similar

}

(written by memory)

Share this post


Link to post
Share on other sites

I'm noticing that the unity web player stutters a lot when I try to open the game (it crashes chrome if i'm not viewing the game while it loads as well), which leads me to think that you are doing all your procedural generation in the onstart method and not in a coroutine.

public void onstart()

{

StartCoroutine(GenerateLevel());

}

public IEnumerator GenerateLevel()

{

GenerateABlock();

yield return new WaitForEndOfFrame(); //or something similar

}

(written by memory)

yeah that's what I did. I thought it was just the unity web player being crappy since I've noticed it crash in a lot of other games as well.. So splitting the generator up over multiple frames would fix that? I'll try it out =). Might as well make a little loading bar too then :D. Thanks man!

Share this post


Link to post
Share on other sites

What tools are you used for creating this ?

I also play around with procedural games. Atm I am trying to make a topdown RPG.

If you want any help/sparring, let me know, would find it very interesting.

I'm using unity for the game

zbrush for the characters

maya for baking the characters and modelling the environment prefabs

photoshop for textures

I don't need any help right now, this is kind off an exercise for myself to try and learn as much about what it takes to make a game as possible. But thanks for the offer :).

Share this post


Link to post
Share on other sites

I'm noticing that the unity web player stutters a lot when I try to open the game (it crashes chrome if i'm not viewing the game while it loads as well), which leads me to think that you are doing all your procedural generation in the onstart method and not in a coroutine.

...
(written by memory)
yeah that's what I did. I thought it was just the unity web player being crappy since I've noticed it crash in a lot of other games as well.. So splitting the generator up over multiple frames would fix that? I'll try it out =). Might as well make a little loading bar too then :D. Thanks man!
hehe yeah thats what i did when i built a level generator that made levels from a .png file :)
public void Start()

    {

        StartCoroutine(SpawnTiles(colors));

    }


    private IEnumerator SpawnTiles(Color[][] colors)

    {

        float posY = 0;

        float posX = 0;

        uint count = 0;

        foreach (Color[] colorRow in colors)

        {

            float absoluteLength = colorRow.Length * colors.Length;


            foreach (Color color in colorRow)

            {

                SpawnTile(color, posX, posY);

                posX += 1;

                count++;

                percentageLoaded = (count / absoluteLength) * 100f;

            }

            posY -= 1;

            posX = 0;

            yield return new WaitForEndOfFrame();

        }

    }


    private static float percentageLoaded = 0f;


    public void OnGUI()

    {

        if (percentageLoaded < 100f)

        {

            string formatted = String.Format("Loading level: {0:00.0}%", percentageLoaded);

            GUI.Label(new Rect(0, 0, 200, 20), formatted);

        }

    }

Only problem being that in order to have a loading bar you need to know the maximum :)

Which you can only get if you procedurally generate the level first, and only THEN instantiates the assets :)

Share this post


Link to post
Share on other sites

I'm noticing that the unity web player stutters a lot when I try to open the game (it crashes chrome if i'm not viewing the game while it loads as well), which leads me to think that you are doing all your procedural generation in the onstart method and not in a coroutine.

...
(written by memory)
yeah that's what I did. I thought it was just the unity web player being crappy since I've noticed it crash in a lot of other games as well.. So splitting the generator up over multiple frames would fix that? I'll try it out =). Might as well make a little loading bar too then :D. Thanks man!
hehe yeah thats what i did when i built a level generator that made levels from a .png file :)
public void Start()

    {

        StartCoroutine(SpawnTiles(colors));

    }


    private IEnumerator SpawnTiles(Color[][] colors)

    {

        float posY = 0;

        float posX = 0;

        uint count = 0;

        foreach (Color[] colorRow in colors)

        {

            float absoluteLength = colorRow.Length * colors.Length;


            foreach (Color color in colorRow)

            {

                SpawnTile(color, posX, posY);

                posX += 1;

                count++;

                percentageLoaded = (count / absoluteLength) * 100f;

            }

            posY -= 1;

            posX = 0;

            yield return new WaitForEndOfFrame();

        }

    }


    private static float percentageLoaded = 0f;


    public void OnGUI()

    {

        if (percentageLoaded < 100f)

        {

            string formatted = String.Format("Loading level: {0:00.0}%", percentageLoaded);

            GUI.Label(new Rect(0, 0, 200, 20), formatted);

        }

    }

Only problem being that in order to have a loading bar you need to know the maximum :)

Which you can only get if you procedurally generate the level first, and only THEN instantiates the assets :)

couldnt you create an arbitrary limit for the maximum size of the level?

Share this post


Link to post
Share on other sites

SO cool! I'm subscribing this thread.

A few minor nitpicks you probably have thought about:

Sometimes it places ramps and lifts in places where the side is the only entrance point. I.e. you may walk down a hallway and find it end at the triangle side. Doesn't affect 'traverse-ability' but it is a little weird. Sometimes lifts end up in corners or two in a row, just a little weird. Maybe make the lifts a little bit faster too?

recognizing that it is very wip and I don't know your gameplay plans:

Gameplay wise I would suggest finding a way to mark areas the players have been to help them keep track of where they have been. Maybe you could add doors so you know if the door is open that means you have been there or maybe a pylon in the middle of large rooms that changes color/sound when you get within x meters so you know you have been there.

Share this post


Link to post
Share on other sites

Gameplay wise I would suggest finding a way to mark areas the players have been

Enemies leave corpses. I loved the way enemies in Doom would leave their corpses behind and you'd have piles of them after big fights!

Share this post


Link to post
Share on other sites

hey guys, it's been a while since I updated this thread, but I didn't stop working on this :)

here's a sneak peak of what's happening:

eyefloater_03.jpg

I hope to have a new playable version up soon, a lot of little things to fix right now~

Share this post


Link to post
Share on other sites

Flying tentacle eyeball brains... In jars!

The new lighting looks great, a lot more moody than before. Look forward to taking it for a spin.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...