QuakeWiki
August 5, 2019

Forums

Welcome Guest

Pages: 1 2 3
Tales From A Newbie's Foray Into The World Of Game Dev.
Mr.BurnsPostJuly 15, 2018, 09:04
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicTales From A Newbie's Foray Into The World Of Game Dev.

[su_tabs]

[su_tab title="Game Overview" disabled="no"]

Game Outline:
The idea behind the main game in the project is that it is a FPS style game with a temporal element to it requiring the player, a soldier with training in “special” forces, to go on missions as directed by “the elders” . The player will be challenged to identify powerful dark enemy forces already within the level who are intent on destruction and shutdown their operations before they are able to complete their mission and jeopardise the player’s very existence. The temporal missions will have a time limit so the player must get the job done or run the risk of being Out Of Time and fail that mission.
I have already added a couple of slightly reworked very “familiar” maps and would like to add a number of popular custom Quake maps for nostalgia’s sake including Cleaver, Aerowalk, Basewalk, Ultrav, and a few others assuming the original authors don’t object. Maybe a few of the Arcane Dimension maps if I can convert them. I hope to finish a fair selection of these before I move on to designing the levels for the main game.
Play Modes:
It will initially be single player but I would like to look at adding coop and multiplayer modes (if I can) further down the line.
Weapons:
The weapons the player will be provided with will change according to the mission parameters and timeline and will be “beamed in” so the player can hunt them out. Initially the following are under consideration as a starting point but more will be added as I think of them or people suggest them to me:
1. One of Knife / Axe / Crowbar (supplied by default)2. Pistol (supplied by default)3. Double Barrel Shotgun

4. Sniper Rifle

5. Machine Gun / Nail gun

6. Grenade Launcher

7. Rocket Launcher

8. Plasma Gun/bfg

9. Crossbow

10. Entrapment weapons (Tripwires, proximity grenades, smoke grenades, Det packs, autosentries, beartraps)

11. The ZPEG/GG (Maybe)

12. Grappling Hook

I also plan to add Powerups including Shields, Healing, Biotoxin antidote, Runes, Teleportation, Biosuits, and Homing Rockets.

Breakable objects are something I will be working on this coming weekend assuming all goes to plan.

Enemies:
TBC, but I hope to have a variety enemies ranging from the straightforward grunt like figures to beasts, to larger “Bosses”.  If possible these too will be varied according to the mission parameters and timeline so what you face in one mission is next necessarily what you will face in the next.

Classes?
I’m no 3D artist but at some point I would like to provide a variety of simple player models to suit different tastes (e.g. female, male, black, white, Asian, older, younger, large and muscular to small, slim and lithe).  While I’m at it I’m tempted to look at classes too, so perhaps something along the lines of selectable player classes with extra stealth, speed, strength or targeting abilities.  Personally I’m not massively keen on class based systems but I’m told they are often popular with the younger player base.

But this is for the future, something to look forward to :)

[/su_tab]

[su_tab title="History" disabled="no"]

 

Well, after having a bit of a break from the trials and tribulations in both the real world and that of QuakeOne.com and seeking to make a few changes in direction I thought I would give NextGenQuake a fair chance and start my own thread. It's a little scary in some ways as you don't know how people will react to you in a new community but, after being inspired by Arrrcee's approach, I thought I would share a few thoughts and ideas I have been working on.

As some in the Quake community will know I have been a developer among other things for quite some years but had never been anywhere near the dark, murky world of Game Development. As I'm no spring chicken and one never knows how long one has got to do these things, I decided to at least try to do something constructive, fun, and maybe learn something (such as another programming language or two) along the way so I could grasp the rudiments of game dev.

But what direction should one go in? That's a good question and in my case as I have got so much pleasure and experience from playing games like Quake 1 and Half Life 2 I decided to do something I was familiar with and had some interest in playing. The general idea was to try and take the best ideas of these games and then build on and incorporate them in to my little free to play FPS project using a modern engine in the hope that it may inspire others with more gifts and talents than I to go further. To be clear, I have zero artistic talent so if I ever finish this thing it won't be pretty but it's only a learning project for a bit of fun.

To help with testing and development I wanted a look and feel that I was comfortable with and so chose a mix of industrial and fantasy themes using freely available content from the web. Initially this includes QRP textures along with PBR and some hi-res images and I take no credit whatsoever for any textures. As "an Easter egg" to the main game, and hopefully encourage people to play the original games, I am including a few reworked versions of some popular levels that are either shareware or freely downloadable.

To give you some illustration of what I'm talking about I have included a few screenshots below. It needs to have the overall lighting turned down and then be rebaked but it should be enough for you to get the idea.. :)

[/su_tab]
[su_tab title="Commands" disabled="no"]
Current Commands:

2 Select Pistol
e Use Item
f Use Flashlight
q Quit Game
r Reload Weapon
SHIFT Run
SPACE Jump
w a s d Move forward, straife left, move backward, straife right

[/su_tab]
[su_tab title="Easter Egg levels" disabled="no"]

Example: e1m67ish

[/su_tab]
[/su_tabs]

I will post updates here as the project moves along but all constructive ideas from the community are gratefully received.

Link: Download lastest demo here

Kind regards

Mr.Burns

OneMadGypsyPostJuly 15, 2018, 13:38
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Would you share that gold armor model with me? I am going to make it way better for you in my spare time. The only reason I need the model is so the size is already established. Note: my spare time is limited and even though it's just a simple model I can tell you right now it's not something I will finish lickety-split but, I will work on it for you and I will eventually have a finished version for you.

Unless you don't want me to help... It's all good either way.

GuestPostJuly 15, 2018, 15:04
Rookie
Posts: 17
Registered:

Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hey Mr. Burns,

Nice to see you around.

Project sounds cool. I will definitely be giving you some feedback if you post updates although I guess it's at an early stage to give any kind of constructive comment or critique. It would be nice to see a list of planned features to figure out more or less what you have in mind.

Mr.BurnsPostJuly 17, 2018, 14:43
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi WizardMachine, Just to come back to you..
Before I reply let me just say that the following is currently more of a wish list of things I would like to develop and add rather than a defined statement of intent or promise to include.  To be clear, some, all, or even none of it may end up being done.

Game Outline:
The idea behind the main game in the project is that it is a FPS style game with a temporal element to it requiring the player, a soldier with training in “special” forces, to go on missions as directed by “the elders” . The player will be challenged to identify powerful dark enemy forces already within the level who are intent on destruction and shutdown their operations before they are able to complete their mission and jeopardise the player’s very existence. The temporal missions will have a time limit so the player must get the job done or run the risk of being Out Of Time and fail that mission.
I have already added a couple of slightly reworked very “familiar” maps and would like to add a number of popular custom Quake maps for nostalgia’s sake including Cleaver, Aerowalk, Basewalk, Ultrav, and a few others assuming the original authors don’t object. Maybe a few of the Arcane Dimension maps if I can convert them. I hope to finish a fair selection of these before I move on to designing the levels for the main game.
Play Modes:
It will initially be single player but I would like to look at adding coop and multiplayer modes (if I can) further down the line.
Weapons:
The weapons the player will be provided with will change according to the mission parameters and timeline and will be “beamed in” so the player can hunt them out. Initially the following are under consideration as a starting point but more will be added as I think of them or people suggest them to me:
1. One of Knife / Axe / Crowbar (supplied by default)2. Pistol (supplied by default)

3. Double Barrel Shotgun

4. Sniper Rifle

5. Machine Gun / Nail gun

6. Grenade Launcher

7. Rocket Launcher

8. Plasma Gun/bfg

9. Crossbow

10. Entrapment weapons (Tripwires, proximity grenades, smoke grenades, Det packs, autosentries, beartraps)

11. The ZPEG/GG (Maybe)

12. Grappling Hook

I also plan to add Powerups including Shields, Healing, Biotoxin antidote, Runes, Teleportation, Biosuits, and Homing Rockets.

Breakable objects are something I will be working on this coming weekend assuming all goes to plan.

Enemies:
TBC, but I hope to have a variety enemies ranging from the straightforward grunt like figures to beasts, to larger “Bosses”.  If possible these too will be varied according to the mission parameters and timeline so what you face in one mission is next necessarily what you will face in the next.

Classes?
I’m no 3D artist but at some point I would like to provide a variety of simple player models to suit different tastes (e.g. female, male, black, white, Asian, older, younger, large and muscular to small, slim and lithe).  While I’m at it I’m tempted to look at classes too, so perhaps something along the lines of selectable player classes with extra stealth, speed, strength or targeting abilities.  Personally I’m not massively keen on class based systems but I’m told they are often popular with the younger player base.

But this is for the future, Let me at least get a pistol to work first.  ?

Kind regardsMr.Burns

Mr.BurnsPostJuly 17, 2018, 15:05
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi MG,

Re the Armour: Happy to share please see attached. Besides I'm sure you will do a much better job especially as it was one of my frist attempts at producing anything in Blender.

Kind regards

Monty

Mr.BurnsPostJuly 17, 2018, 15:36
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi MG,

Re: ".. Finish that map and compile something playable and I’ll move you to mods/projects. By “playable” I just mean we can walk around in it at least..."

It will probably crash and burn or not run at all but if you are at a loose end maybe give the demo from the following addy a try - https://1drv.ms/u/s!AqxgY7srs-bFpx2t2ZLrlgz3Vk4C .  If you are crazy enough to actuall try it :)  some points to note

1.  You will start at a tempory hub just added for dev and map testing. This will be changed for later releases

2. I have been testing a regenerative health feature over the weekend so when you go from the hub to the e1m67ish level you will start with around 10 health. As the health increases at around 1 unit per second the HUD will slowly clear as it goes through the 25%, 50%, 75% and 80% milestones. This will be changed for later releases

3. The e1m67ish level seems to take quite a while to load when selected in the hub. I'm guessing this may be down to file size but please be patient.

4. To exit, you [currently] have to press the q key.

5. Yes the "crazy-lights, bizarro-world" part of the map :D  is still there. I did turn the lighting down a little (probably not enough though) and added the lava walkway, activation button, and exit gateway section a seen in the image shot in the OP. I will probably take it down further and remove some of the flares to get that gloomy shadowy atmosphere.

6. ALL temporary lava textures will be replaced in the next few months

kind regards

Monty

OneMadGypsyPostJuly 17, 2018, 21:40
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

I did what I said I would do. You provided a "playable" level. I made you a graphic and turned you into news. We can always change the graphic to something else if you don't like what I made. I am a totally half-assed graphic artist so, I don't have the skills to make something amazing for you. I struggle with "presentable". I can't say that I did my best, though. I have limited time. It took 6 tries to make it look "as good as it does" and I just can't spend any more time on it ATM.

@please see attached

There is nothing attached :D.

GuestPostJuly 18, 2018, 15:59
Rookie
Posts: 17
Registered:

Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

First of all, glad to see you're using Unity3D, at first I thought all those images were produced with one of the Quake engines.

I tested the demo and here's a few points:

  • I was a bit confused at the start and didn't really know in which direction to go
  • Player controller feels a bit strange, as if it were not responsive enough (it has a tinsy delay before it finally stops or starts moving). Since I've also recently developed an FPS controller in Unity, here is how I'm moving my FPS controller:

    rigidbody.velocity = (GetComponentInChildren<Camera>().transform.forward * forwardInput * forwardVel) * _speed;

    I'm moving in whichever Vector the camera is facing at that particular moment, later I simply limit movement so that it doesn't fly around, but in general the responsiveness I get when using WASD through Input.GetAxis("Vertical/Horizontal") is much better than anything I got with other systems (Unity's CharacterController for example). In the end it's probably just a matter of tweaking some of the values you're using.

  • The end: I think I reached the end of the level (big circly roundly mirrorish thingy in some sort of hidden well down below?) but I can't do anything beyond that point.

Also, I totally understand this is still under heavy development and the things I mentioned normally tend to be 'flattened out' later on during testing so don't take my feedback too seriously anyway. I can already feel the Quakeness when playing through it.

Mr.BurnsPostJuly 20, 2018, 16:59
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi WizardMachine,

Thanks for the constructive feedback, it's always appreciated.

Re."..Player controller feels a bit strange.."

Thanks for this, I'll take a look and see if Unity will allow me to tighten the controls up a little.

Re "..I was a bit confused at the start and didn’t really know in which direction to go.."

That's understandable :)  At the moment it is just an unlocked world to run around in and get a feel for the surroundings. When I start adding monsters/opponents/puzzles/challenges the main doors will initially be locked until you defeat them or find secrets and illuminate the way forward.

Re "The end...I can’t do anything beyond that point" .

Apologies, this has now been fixed so that it will teleport you back to the temporary main hub map. I'll upload it tomorrow along with hopefully a first stab at a weapon. :)

Kind regards

Monty

Mr.BurnsPostJuly 23, 2018, 04:48
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Time for a small update:

  1. The Jumpgate at the end of the e1m7 tunnel has been activated and now should take you back to the hub.
  2. A simple Pistol added.
  3. A HUD element has been added to display the current ammo level based on the selected weapon
  4. Reload function added
  5. Bullet hole decals added for stone surfaces

By default the player will have a pistol and a melee weapon . The pistol is selected by pressing number 2 above your normal keys on the keyboard. The pistol is based on an M9 and has a clip of 15 bullets. The player can carry up to 50 bullets and the pistol can be reloaded by pressing the r key.

To do:

  1. add surface type detection so that different impact decals can be displayed depending on the surface hit.
  2. Add further impact effects for projectiles hitting water / wood / etc

If anyone has any trouble downloading or spots any issues please let me know.

Download link:  OOT demo

Kind regards

Monty.

OneMadGypsyPostJuly 23, 2018, 08:55
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

@Monty Burns

I'm assuming you updated the news post with your link (I'm on my phone). You may want to consider that it's possible to come to this thread and bypass the news so, it could get confusing as to where the download link is. If you haven't already you probably want to update the link in the OP.

Please forgive me if you already figured all this out and handled it. I can't check this kind of stuff from my phone. Another thing you may want to consider is to use your signature, as well.

Mr.BurnsPostJuly 23, 2018, 12:30
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi MG,

That's a good point concerning the download links but fortunately the download repo didn't act as expected and allowed me to replace the previous demo with the latest version apparently without changing the download link, so hopefully it should be downloadable (please let me know if not). I took your helpful suggesion on board and I've put additional D/L links in place in both the OP and the update posts.

Kind regards

Monty

Mr.BurnsPostAugust 4, 2018, 10:43
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Update 3rd August 2018:

I've been away so this is just a small update with the following changes...

  1. The 3 Floor switches have been enabled to instigate a) the lowering of the two electrodes, and b) the firing of the plasma beam between them in the lava pit area
  2. Lava pit Laser beam particles added in to e1m7ish
  3. The overall brightness has been turned down especially in lava pit area
  4. 2 wall torches have been removed around the lava pit to add to the gloomy atmosphere

The download zip has been updated and the link is in my sig. Have fun - more updates are already in production and all constructive criticism is welcome.

Kind regards

Monty

PhenomPostAugust 4, 2018, 19:59
Rookie
Posts: 19
Registered:
August 4, 2018, 05:19
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

I attempted to play this last night and made it past the start screen, not before I tried to jump into the water - only to be respawned back on the platform which was unacceptable to I jumped out into the water as far as I could directly towards an obvious broken seam in the water and found a secret place where you can fall forever!

After restarting the game I stopped fooling around and bug hunting and ran to the first portal (I really like the look of the portals btw). The game was running fine for about 3-4 minutes as I had continuous flashbacks of Quake as I ran around, then the game crashed.

Honestly I don't remember exactly where or what I was doing when it crashed but at that point I was already knee deep in 30+ open tabs, my own game project and roughly 3am+ in the morning so I decided its best to stop there for now. I'd like to see where this goes though!

The controls feel like MAYBE you might be doing the movement in "LateUpdate()"? Or you're using physics to move the player capsule? This would cause the latency in the movement which was quite disorienting.

The camera fov felt very weird, I believe the default is 60 for cameras?

I like the idea of seeing people's games in this fashion, just like "Hey here's what I've been wanting to work on and now I'm showing you people!". I believe that's how good things happen and born into existence!

Keep up the good work! Maybe someday we'll be working together! :)

Mr.BurnsPostAugust 6, 2018, 14:53
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Hi Phen
Firstly thanks for giving it a try and thanks also for the feedback and kind words. I'm a firm believer in constructive feedback and providing responses to it wherever possible so here goes...

1. Hub/Start level catch teleporter:
The Hub is just a temporary map to allow testers to jump in to and test the maps as they come on line. It won't be there in the finished game as I've got some grander ideas for that. The teleporter in the water was aimed at getting those players who may have inadvertantly fallen off the platform back on to it as easily as possible. Clearly I must have understimated your jumping skills :) I've now enlarged the teleporter trigger from 75 to 150 units.

2. Hub level Water "Seams".
Oddly enough the seams you could see in the water was how it came "out of the box". The 2 water tiles have now been adjusted slightly and the hopefully it shouldn't be so obvious. If it still looks rubbish please let me know and I will try and enlarge one tile to fit.

3. FOV
You are obsolutely right, the default FOV on the unity camera appears to be set to 60. I'm conscious of trying to avoid the "fish eye" look but I've tried resetting it to 90 and we'll see how that goes.

4. Movement
Wizard machine also mentioned the movement feels a bit strange and after a little digging it seems that the Movement is controlled by Unity's own FirstPersonController script and appears to get its input from the following..
float horizontal = CrossPlatformInputManager.GetAxis("Horizontal");
float vertical = CrossPlatformInputManager.GetAxis("Vertical");

...and a few GetKey commands

It then seems to process this input inside a FixedUpdate() as opposed to the standard update() function.

I've tried updating all of the keyboard move input commands to increase the sensitivity from 3 to 10 but I'm not 100% sure thats the issue. It may need a custom controller script as alluded to by Wizard Machine but I've got a sneaky suspicion that it is relatied to inmput polling but I guess it is a case of trial and error until we get the proquake feel to the movement. That said, if you have any suggestions feel free to let me know :)

5. Crash
If you have any more information on the crash that might help me pin point what you were doing, or if it happens again I would be grateful if you would let know.

I've update the demo with the changes mentioned above.

Next is a machine gun and maybe a another familiar map or two... :)

I'm not sure I'm anywhere near your programming level, you little QuakeC diva you :) , but I'm happy to learn from people like yourself, baker, the mighty Rook, and Spike (although I think I might need a phrase book and commander data's neural net for the later) :D

Kind regards

Monty

Mr.BurnsPostAugust 20, 2018, 15:42
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Just a small update, I've been experimenting with adding a few Volumetric lights to a test scene (in the example below - e1m5ish) and trying to get the best "bang for my buck" in terms of lighting effects vs performance.  Given my limited experience of any modern games past Quake, Half Life 2,  Borderlands 2 and Dishonoured I wondered if these kind of effects were considered out of date or a bit corny and would appreciate any guidance from any "modern gamers".

Many thanks

Monty

OneMadGypsyPostAugust 20, 2018, 18:07
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Look at you making awesome updates to your OP. Great Job!! The logo looks great!

One thing I have noticed about your screenshots is the colors look washed out. It's almost like instead of varying the "fullbrightness" of the texture it's just dumping white on top. It looks like a 'hard light' filter.

Image

If I changed the fake lightmap to pure white and black the hard light side will be pure white and black. This happens a lot in your screenshots. I'm not willing to bet any of my testicles on it or anything but, by observation, you are using a hard light filter. Use multiply.

You'll have to adjust all your lights after doing this. Your level will become a lot darker. The thing is, light does not add light. Light subtracts dark. However your textures look originally is the brightest they should ever be. Of course you can have an over bright situation but, that should probably be set on the light (or maybe extra lightmap) that will create an over bright. Your stock lights shouldn't be adding anything to the texture.

Mr.BurnsPostAugust 21, 2018, 15:51
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Thanks for taking to the time to respond MG, I certainly learned something as I didn't know about the lighting method. I did a little testing when I got in from work this evening and captured the following using a diffferent method...

I've got a feeling that it could be partly due to the fact that the map is still being textured and consequently hasn't been baked and had the static lighting generated yet, and also due to that fact that in the interests of expediency I was using the Windows "Snip" tool to capture what was within the Unity Inspector (Work area) window.

I always intended to add a screenshot feature so I thought now is as good a time as any. The above image is taken in the same room using the new feature. This looks a little clearer on my screens but if you still think it needs work please let me know

For anyone wishing to add the same feature, there's probably a much better way to do it but here is an early example what worked for me:

  1. Edit --> Project  settings --> Input
  2. Ensure that you create an entry point for the f11 key (or whatever key you prefer)
  3. Create a c# script and attach it to the player
  4. In the Update() section add the following and then save and press play

if (Input.GetKeyDown("f11"))
{
string strSnapshotFilename;

strSnapshotFilename = "MGsCoolSnapshot.png";
ScreenCapture.CaptureScreenshot(strSnapshotFilename);
}

By default it will overwrite the previous file with the same name but you could easily add in a time stamp element to the strSnapshotFilename to ensure a new png is created for each capture. For example...

strSnapshotFilename = "OOT_" + System.DateTime.Now.ToString("MM-dd-yy_hh-mm-ss") + ".png";

I hope this helps

Kind regards

Monty

OneMadGypsyPostAugust 21, 2018, 16:39
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

It's not really clear from your post if anything I said actually got implemented but, whatever you did, it looks a lot better. The colors are way more vibrant. Now you just need to tweak your lights and add more lights, and it will start looking really good.

edit: I don't think the snip tool had anything to do with it. When I played your map it had that washed out look. It's still a good idea that you added the screen capture feature, though.

Mr.BurnsPostSeptember 12, 2018, 17:52
Rogue
Posts: 47
Registered:
January 12, 2018, 09:03
Very Hot topicReply To: Tales From A Newbie's Foray Into The World Of Game Dev.

Just a small update:

I always liked Quake Engines like Qrack especially all the groovy effects Rook was incorporating in to it, not least the cool under water effect which seemed so much better than Quake's original. I wondered how I could do it with my little project and I tried a few things, and although I'm sure there is probably a much better way of doing it, what worked for me at this point was to create a trigger on the map that would change settings within the players view screen when the player enters that environment and activates it and then return those settings back to normal when the trigger was exitted.

This is the current view under water without without any water effects...

In case it helps others who may be interested in doing the same thing here is what I did...

I added a 3d Cube gameobject in to the level and positioned it below the water. I turned of the mesh renderer so that it would be invisible to the player, and ensured that it had a box collider (seen in green below) which was set as a trigger. That simply means that when it comes in to contact with something, such as the player, it will register the event and allow you to script something to happen.

With the trigger in place we need a script to handle the trigger activation event (when the player touches it) and tell the game what to do when that happens. As I want to use this script for all sorts of environments the player may be in I created a script called scrPlayerEnvironmentalEffects.cs.   I added the code below to be executed if the environment the script is attached to is a body of water (or in this case a water trigger).

public string EnvironmentType;                                // Allow the designer to specify the type of environment
// triggering the script (e.g. "Water", "Lava", "Acid", "Gas", etc)

private void OnTriggerStay(Collider other)
{
if (EnvironmentType == "Water")
{
GameObject.Find("FPSController").GetComponent<scrPlayerStatus>().bolPlayerInWater = true;
GameObject.Find("FPSController").GetComponent<scrPlayerStatus>().PlayerEnvironmentCurrent = "In Water";
}
}

private void OnTriggerExit(Collider other)
{
GameObject.Find("FPSController").GetComponent<scrPlayerStatus>().bolPlayerInWater = false;
GameObject.Find("FPSController").GetComponent<scrPlayerStatus>().PlayerEnvironmentCurrent = "On Land";
}
}

What does it do? Well, my player object on this map is called "FPSController" and already has a script attached to it called scrPlayerStatus.cs to handle player health, inventory, etc.  When the player touches the trigger in the water it will change 2 variables (bolPlayerInWater = true, and PlayerEnvironmentCurrent = "In Water"  )  in the PlayerStatus script. When the player exits the trigger, i.e, leaves the water, the 2nd section of the script fires to restore those variables in the PlayerStatus script back to normal.

The PlayerStatus script has a section called update() which runs constantly and I'm using it to detect any changes to the player such as when they move in to different environments like water, acid, slime, etc.

private Color UnderWaterColour = new Color (0f, 0.175f, 0.25f, 0.125f);       // Under water colour
private bool defaultFog;                                                                                   // Default Fog on.off setting
private Color defaultFogColour;                                                                       // Default Fog Colour
private float defaultFogDensity;                                                                        // Default Fog Density

void Update() {

if (bolPlayerInWater == true)
{
RenderSettings.fog=true;                                           // As it is a single player game turn on global fog
// RenderSettings.fogColor=Color(0, 0.4, 0.7, 0.6);
RenderSettings.fogColor = UnderWaterColour;         // Change the colour of the fog to the blue underwater color.
RenderSettings.fogDensity=0.05f;                              // Set the density
}

if (PlayerEnvironmentCurrent == "On Land") {
RenderSettings.fog=defaultFog;                                      // Return the fog to the default setting before entering the env
RenderSettings.fogColor=defaultFogColour;                  // Restore the fog colour to the default setting
RenderSettings.fogDensity=defaultFogDensity;             // Restore the fog density to the default setting
}

}

As you can see above when the variables in the PlayerStatus script are changed to suggest that the player has entered a water environment, as a result of the trigger being fired, it changes a number of global fog settings. It also reverses them when the trigger is exited and hence the variables reversed/reset.

Results:

View from above the water in e1m5ish...

Partially submerged in the water...

Submerged obstructed view...

Submerged longer view.

I hope to add to further things to the under water view, 1. water caustics, and 2. something very similar to Seven's "scuba mask" anim when you exit the water. I've just got to figure it out ;) In any event I hope this may be of use to somebody trying to do the same thing and there will be more updates soon

Kind regards

Monty

Pages: 1 2 3
Page loaded in: 0.095 seconds.