Nox Forum

NoX2 Discussion => Content Creation => Topic started by: Morden Tral on March 28, 2011, 03:14:14 pm



Title: Level Creation Standards
Post by: Morden Tral on March 28, 2011, 03:14:14 pm
I adopted much of what prophet used when he created deathtrap1.udk, his sizing and proportions weren't too bad and I scaled the character based on it so all future maps should probably use these measurements as a standard.


Requirements before mapping:

Tortoise SVN or another reliable SVN client:
http://tortoisesvn.tigris.org/ (http://tortoisesvn.tigris.org/)

USE Latest UDK release

The NoX2 project files:
http://nox3d.svn.sourceforge.net/svnroot/nox3d/NewNoX2 (http://nox3d.svn.sourceforge.net/svnroot/nox3d/NewNoX2)


As I add to the game you will be able to download the newest / greatest additions through the SVN.

Install UDK Augest to a folder titled "NoX2" and right click on it, go to tortoise svn and "checkout directory", use the nox2 project files link in the checkout location field. Ensure that you are NOT CHECKING OUT to a subfolder in the folder, it will intially try to set destination to "folder/newnox2", delete newnox2 from the path to make sure it writes all of the files into the correct places.

In the folder there are two things you must do first:

\Binaries has Unrealfrontend.exe, create a shortcut to it on your desktop

\Binaries has UDKLift.exe, create a shortcut tot it on your desktop, and then add editor after the path in the target field of the shortcut. IE: "c:\udk\nox2\udklift.exe" editor

Run unrealfrontend.exe and click on make, if everything installed correctly then the game should compile

Then run the new udklift shortcut (you might want to rename is udk editor) and you can get started mapping. UDK Editor specific tutorials are available all around the net, the rest of this post will simply deal with NoX2 specific requirements and issues.




Walls:

Thickness: 16 units thick for interior walls seems good

Length: No more then 512 per section to ensure that the LOS system works correctly, keep in mind that this is only to ensure that the auto LOSVolume creation detailed below is straight and simple. You may use w/e length walls you want if you go back and split the single large LOSVolume created up into smaller 512 long sections.

Height: 192 units, this is a MUST for all walls that use the LOS system, otherwise the characters will be drawn over when jumping.

LOSsystem: You must place LOSVolumes around each wall that you wish the LOS system to be drawn from (this means you can have walls without LOS). The easy way to do this is to select a wall brush, and then go into right click and select all adjacent brushs and holding alt drag them all a little over to the side. This will make a copy of every wall in the map at once, then you right click and select Convert-LOSVolume to turn the copies into LOSVolumes. Just drag the new volumes back to their original location on top of all of the walls and you are good to go.

Windows:

Size and placement: Does not matter

Usage: Place a LOSVolume at the location for the area you want cleared on approach, then go into the LOSVolumes properties and set the var "bIsWindow" to true.

*Note*: If you created the LOSVolumes on the map as detailed in the walls section above then you'll need to delete the single large volume created by that process on that wall section first unless you want the just set the entire wall to windows.

Doors:

Not yet implemented

Items:

Keep in mind that the bottom wall is not drawn or semi transparent like in nox, you must not place items behind it.

Objects:

W/e you feel like, however beware when placing very tall objects near walls that are casting the LOS. It will draw over the top of the mesh as the LOS system is in the HUD level of drawing, not the 3d/rendering level.


Title: Re: Level Creation Standards
Post by: Imm0Rtal on April 07, 2011, 05:14:28 pm
How bad is it that the walls are not transparent like in the original Nox?

We will have large gaps of the map that players can't see themselves behind..

Isn't this bad?


Title: Re: Level Creation Standards
Post by: Morden Tral on April 07, 2011, 06:14:03 pm
No? what exactly do you need to see?

Also the name appears above and the wall height is currently set to where total occlusion is only barely possible. I can even modify the camera angle to be more extreme if I feel like it.


Title: Re: Level Creation Standards
Post by: #zx.pr0jk on April 08, 2011, 03:34:50 am
If there's a potion on the ground behind a wall.


Title: Re: Level Creation Standards
Post by: Morden Tral on April 08, 2011, 11:03:35 am
Then it gets lost, fuck it. The LOS system literally makes the potion situation impossible to fix unless I start drawing outlines to the hud or manually force them away from walls. It's something that will almost never come up in the first place.

I don't have access to the rendering order without a license so I can't calculate the LOS until AFTER rendering is done so it has to be drawn to the hud.


Title: Re: Level Creation Standards
Post by: #zx.pr0jk on April 08, 2011, 02:05:57 pm
Comes up a lot, actually. But I was just answering:

what exactly do you need to see?


Title: Re: Level Creation Standards
Post by: Morden Tral on April 08, 2011, 02:50:29 pm
It comes up when the potion is auto dropped down on death, its not hard to force items to spread up instead.


Title: Re: Level Creation Standards
Post by: Imm0Rtal on May 10, 2011, 03:53:31 pm
Why do you need a license to do this?

Isn't the license dependent on the fact you plan to release this game?


Title: Re: Level Creation Standards
Post by: Morden Tral on May 10, 2011, 04:19:01 pm
I don't?

I just don't have source control in the udk so I had to make a hackish LOS system instead of a super clean one. Makes me happy though because unreal themselves told me it'd prob be impossible to do it without source control and I proved em wrong.


Title: Re: Level Creation Standards
Post by: Imm0Rtal on May 24, 2011, 08:37:56 pm
Get Source Control


Title: Re: Level Creation Standards
Post by: Morden Tral on May 25, 2011, 12:38:27 pm
Give me 20k


Title: Re: Level Creation Standards
Post by: #zx.pr0jk on May 25, 2011, 01:49:37 pm
kkkkkkkkkkkkkkkkkkkk


Title: Re: Level Creation Standards
Post by: Imm0Rtal on May 25, 2011, 08:12:49 pm
Give me 20k

Your the one in the munnies.. Get a 20K dowry for marrying your girlfriend.  :|


Title: Re: Level Creation Standards
Post by: PuffCaKe on March 11, 2013, 12:31:59 am
Why not just make dropped items temporarily physical props, then freeze them after motion is done


Title: Re: Level Creation Standards
Post by: Imm0Rtal on March 12, 2013, 02:58:44 am
Why not just make dropped items temporarily physical props, then freeze them after motion is done

This has nothing to do with the original problem posted in this thread. DURP


Title: Re: Level Creation Standards
Post by: Morden Tral on March 12, 2013, 03:57:40 am
I have no idea what she is talking about, I hope it isn't what it looks like because it already does that.


Title: Re: Level Creation Standards
Post by: PuffCaKe on March 12, 2013, 09:32:45 pm
I am talking about the potions stuck in the wall?


Title: Re: Level Creation Standards
Post by: Morden Tral on March 12, 2013, 10:24:21 pm
....That was never the issue


Title: Re: Level Creation Standards
Post by: PuffCaKe on March 13, 2013, 10:05:59 pm
Well... This is awkward... -_________________-


Title: Re: Level Creation Standards
Post by: Imm0Rtal on March 14, 2013, 09:24:26 pm
Well... This is awkward... -_________________-

God Dammit Misha. Just post on your regular name.


Title: Re: Level Creation Standards
Post by: PuffCaKe on July 12, 2013, 07:42:22 pm
I have a problem installing the svn.

I am kinda newbie so i already know you hate me, you don't have to say it I already know.

What I did was

1) In the "Nox2" folder of the udk I right clicked and did svn checkout. The dir was c:/udk and the folder i clicked was nox2 test

2) I changed the install dir from Nox2 testnew to nox2 test

3) I waited for it to install

4) I created a shortuct From "UnrealFrontend" to the desktop

4) I created a shortcut to "UDKLift"

5) I right clicked on UDKLift and added editor to the target

6) I was not sure what to do from there, the unrealFrontend thing did not have a "Make" button

7) I ran the program (Nox 2 Test) and it came up with a "Must rebuild message" or something like it was too old or something

8) I notice that my characters name had changed from "Player" to my Gmail account name...?

9) nothing else changed, the same map, same models and same gliches... It should be mensiond that when it was rebuilding it had a bunch of errors like could not find player class and stuff

So please help me. I am utterly useless I guess so yeah....
Posted on: July 12, 2013, 03:40:15 PM
Also on the file folder "NoX2 Test" there is now a little red exclamation mark.


Title: Re: Level Creation Standards
Post by: Evengard on April 01, 2014, 04:13:31 pm
Morden, Hi. Can you please comment how actually the LOS system was implemented? Because I look at the code and I can't get how it works.


Title: Re: Level Creation Standards
Post by: Morden Tral on April 01, 2014, 06:53:32 pm
UDK doesn't support custom/deferred shadow mapping fully (Real time shading is slow as shit and a hack job), so to get any sort of LOS system at all I embedded custom LOSVolumes in the maps that would define an area to project the view frustum from. Then in the Canvas / HUD system I would project the Volumes location into the 2D space and draw polygons to define where the shadow is. This had the unfortunate side effect of being drawn after the geometry and thus not allowing proper depth rendering (cutting off players heads if they jump too high before I raised the walls, ect ect). It would have been decently good if the canvas element in UDK allowed for opacity in the textures but sadly it does not.


In UE4 it would be far simpler because you can just use a custom shader to manage a LOS/Fog of war system using deferred shadow mapping to project the real time shadows.

Also for the record, UE4 is fantastic.

I've pasted the LOS triangle loading function below, the code base was messy as hell but mostly functional. I didn't see a point in optimizing it as I dropped the project not that long after I had a working system. If you want to look at it more in depth the NoXPlayerHud.uc file in the source has the drawing loop and that function in it.

Code:
function DrawLOS(Canvas Canvas1)
{
local NoXPawn myPawn;
local NoXPlayerController myController;

local LOSVolume LOSVol;
local Vector temVec;

local Vector PawnLocation;
//local Vector2D PawnLoc;

local Vector One,Two,Three,Four,Five,Six,Seven,Eight;
local Vector OneLoc,TwoLoc,ThreeLoc,FourLoc,FiveLoc,SixLoc,SevenLoc,EightLoc;

local int CheckX,CheckX2;
local int CheckY,CheckY2;

local Vector screenLoc;
local Vector outLoc;
local Vector hitLoc;
local Vector hitNormal;
local Vector StartTrace;
local Vector EndTrace;
local Vector2D ScreenSize;
//local Canvas Canvas1;

if( !bDrawTrueSight )
return;

myController = NoXPlayerController(PlayerOwner);
myPawn = NoXPawn(myController.Pawn);

PawnLocation = myPawn.Location;
PawnLocation.Z = 0;
PawnScreenLoc = Canvas1.Project(PawnLocation);


ScreenSize.X = self.SizeX;
ScreenSize.Y = self.SizeY;
Canvas.Deproject(ScreenSize,screenLoc,outLoc);
StartTrace = (IsometricCamera(myController.PlayerCamera)).ViewTarget.POV.Location;
EndTrace = StartTrace + outLoc * 5000;
Trace(hitLoc, hitNormal, EndTrace, StartTrace, false);


CheckX = hitLoc.X;//myPawn.Location.X//+400; //500
CheckY = hitLoc.Y;//myPawn.Location.Y//+400;//500


ScreenSize.X = 0;
ScreenSize.Y = 0;
Canvas.Deproject(ScreenSize,screenLoc,outLoc);
EndTrace = StartTrace + outLoc * 5000;
Trace(hitLoc, hitNormal, EndTrace, StartTrace, false);

CheckX2 = hitLoc.X;//myPawn.Location.X//-300;//400
CheckY2 = hitLoc.Y;//myPawn.Location.Y//-300;//400

foreach AllActors(class'LOSVolume', LOSVol)
{



temVec.X = LOSVol.BrushComponent.Bounds.Origin.X + LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y + LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = LOSVol.BrushComponent.Bounds.Origin.Z + LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Two = Canvas1.Project(temVec);
TwoLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X - LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y + LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = LOSVol.BrushComponent.Bounds.Origin.Z + LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//One = Canvas1.Project(temVec);
OneLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X - LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y - LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = LOSVol.BrushComponent.Bounds.Origin.Z + LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Three = Canvas1.Project(temVec);
ThreeLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X + LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y - LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = LOSVol.BrushComponent.Bounds.Origin.Z + LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Four = Canvas1.Project(temVec);
FourLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X - LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y + LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = 0;//LOSVol.BrushComponent.Bounds.Origin.Z - LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Six = Canvas1.Project(temVec);
SixLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X - LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y - LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = 0;//LOSVol.BrushComponent.Bounds.Origin.Z - LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Five = Canvas1.Project(temVec);
FiveLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X + LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y + LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = 0;//LOSVol.BrushComponent.Bounds.Origin.Z - LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Seven = Canvas1.Project(temVec);
SevenLoc = temVec;

temVec.X = LOSVol.BrushComponent.Bounds.Origin.X + LOSVol.BrushComponent.Bounds.BoxExtent.X;
temVec.Y = LOSVol.BrushComponent.Bounds.Origin.Y - LOSVol.BrushComponent.Bounds.BoxExtent.Y;
temVec.Z = 0;//LOSVol.BrushComponent.Bounds.Origin.Z - LOSVol.BrushComponent.Bounds.BoxExtent.Z;
//Eight = Canvas1.Project(temVec);
EightLoc = temVec;


if((
(LOSVol.BrushComponent.Bounds.Origin.X > CheckX || LOSVol.BrushComponent.Bounds.Origin.X < CheckX2) &&
(LOSVol.BrushComponent.Bounds.Origin.Y > CheckY || LOSVol.BrushComponent.Bounds.Origin.Y < CheckY2) &&

(FourLoc.X > CheckX || FourLoc.X < CheckX2) &&
(FourLoc.Y > CheckY || FourLoc.Y < CheckY2) &&

(TwoLoc.X > CheckX || TwoLoc.X < CheckX2) &&
(TwoLoc.Y > CheckY || TwoLoc.Y < CheckY2) &&

(SixLoc.X > CheckX || SixLoc.X < CheckX2) &&
(SixLoc.Y > CheckY || SixLoc.Y < CheckY2) &&

(FiveLoc.X > CheckX || FiveLoc.X < CheckX2) &&
(FiveLoc.Y > CheckY || FiveLoc.Y < CheckY2)

))
continue;

One = Canvas1.Project(OneLoc);
Two = Canvas1.Project(TwoLoc);
Three = Canvas1.Project(ThreeLoc);
Four = Canvas1.Project(FourLoc);
Five = Canvas1.Project(FiveLoc);
Six = Canvas1.Project(SixLoc);
Seven = Canvas1.Project(SevenLoc);
Eight = Canvas1.Project(EightLoc);
//MatCanvas1.DrawColor = MakeColor(255,0,0,255);
//MatCanvas1.SetPos(MatCanvas1.SizeX/2,MatCanvas1.SizeY/2);
//MatCanvas1.DrawBox(4,4);

/*Canvas1.DrawColor = MakeColor(255,255,255,255);
Canvas1.SetPos(One.X,One.Y);
Canvas1.DrawText("One");

//Canvas1.DrawColor = MakeColor(255,0,0,255);
Canvas1.SetPos(Six.X,Six.Y);
Canvas1.DrawText("Six");

//Canvas1.DrawColor = MakeColor(255,0,0,255);  
Canvas1.SetPos(Eight.X,Eight.Y);
Canvas1.DrawText("Eight");*/

if( LOSVol.bIsWindow )
AddWashTriangle(One,Two,Three,Four,true);
else if( LOSVol.bIsDoor )
AddWashTriangle(One,Two,Three,Four,false,true);
else
AddWashTriangle(One,Two,Three,Four,false);

if( LOSVol.bIsWindow )
{
if((
((LOSVol.BrushComponent.Bounds.Origin.X-LOSVol.BrushComponent.Bounds.BoxExtent.X < myPawn.Location.X+80 &&
LOSVol.BrushComponent.Bounds.Origin.X+LOSVol.BrushComponent.Bounds.BoxExtent.X > myPawn.Location.X-80) &&
LOSVol.BrushComponent.Bounds.Origin.Y-LOSVol.BrushComponent.Bounds.BoxExtent.Y < myPawn.Location.Y+80 &&
LOSVol.BrushComponent.Bounds.Origin.Y+LOSVol.BrushComponent.Bounds.BoxExtent.Y > myPawn.Location.Y-80)
  ))
continue;
}


if( PawnLocation.Y <= SixLoc.Y /*&& PawnLocation.X <= EightLoMatCanvas1.X*/ || PawnLocation.Y/*-25*/ <= SevenLoc.Y /*&& PawnLocation.X >= FiveLoMatCanvas1.X*/)
{
// Side 2
AddViewTriangle(Four, Three, Eight, Five);
//AddViewTriangle(One, Two, Six, Seven);
}

if( PawnLocation.Y >= SevenLoc.Y /*&& PawnLocation.X <= SevenLoMatCanvas1.X*/ || PawnLocation.Y >= SixLoc.Y /*&& PawnLocation.X >= SixLoMatCanvas1.X*/)
{
// Side 1
//TriangleList.Remove(0,TriangleList.Length);
AddViewTriangle(One, Two, Six, Seven);
}

if( PawnLocation.X >= FiveLoc.X /*&& PawnLocation.Y >= EightLoMatCanvas1.X*/ || PawnLocation.X >= SixLoc.Y/* && PawnLocation.Y <= SevenLoMatCanvas1.X*/)
{
// Side 3
//TriangleList.Remove(0,TriangleList.Length);
AddViewTriangle(Four, Two, Eight, Seven);
//AddViewTriangle(Three, One, Five, Six);
}

if( PawnLocation.X <= FiveLoc.X /*&& PawnLocation.Y >= FiveLoMatCanvas1.X*/ || PawnLocation.X <= SixLoc.Y /*&& PawnLocation.Y <= SixLoMatCanvas1.X*/)
{
// Side 4
//TriangleList.Remove(0,TriangleList.Length);
AddViewTriangle(Three, One, Five, Six);
//AddViewTriangle(Four, Two, Eight, Seven);
}

// Now need to run the wall ends
// Wall only visual aspects

/* if( !LOSVol.bDisableAllCorners )
{
if( LOSVol.bEnableCorner3 && (PawnLocation.Y >= FiveLoc.Y && PawnLocation.X <= FiveLoc.X || PawnLocation.Y <= FiveLoc.Y && PawnLocation.X >= FiveLoc.X))
{
// Corner 3
AddViewTriangle(Five, Three, Five, Five);
}

if( LOSVol.bEnableCorner1 && (PawnLocation.Y <= SixLoc.Y && PawnLocation.X <= SixLoc.X || PawnLocation.Y >= SixLoc.Y && PawnLocation.X >= SixLoc.X))
{
// Corner 1
AddViewTriangle(Six, One, Six, Six);
}

if( LOSVol.bEnableCorner2 && (PawnLocation.Y >= SevenLoc.Y && PawnLocation.X <= SevenLoc.X ))
{
// Corner 2
AddViewTriangle(Seven, Two, Seven, Two );
}
if( LOSVol.bEnableCorner2 && (PawnLocation.Y <= SevenLoc.Y && PawnLocation.X >= SevenLoc.X))
{
// Corner 2
AddViewTriangle(Seven, Two, Seven, Seven);
}

if( LOSVol.bEnableCorner4 && (PawnLocation.Y <= EightLoc.Y && PawnLocation.X <= EightLoc.X ))
{
// Corner 4
AddViewTriangle(Eight, Four, Eight, Eight);
}

}*/
}
}