Consulting, services, computer engineering. Implementation of technology solutions and support for businesses.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Windows 11 v26080 Csharp First FPS building the level

 

Windows 11 26100 Csharp First FPS building the level

Windows 11 v26100 Csharp First FPS building the level

 

 

 

Who am i / About the author...

ident021 180 facebook linkedin insider mcp learn metadatas sans cravate 128x128 autocolors 18052006 191123 mcse microsoft logomcsa microsoft logomcdba logo

since 2001, Insider since 2014.

 

Thanks to Microsoft EMEA GBS to let me participate in the year 2014 to the Insider project during my work. Then, This Windows test project, here in version 11, is based on the cycle of the insider Preview Builds, now in the Dev Channel: it is fun to test the new features. I can learn new features, validate them and share them with you :-)

Why game engines? Because as a system/network/database developer I only see consoles and screens with unfunny and ugly text. With game engines i can show you colors and animations, that's more fun and more eye-catching :)

This tutorial is made in a test environment, for pleasure and not to earn money. It is a non-profit project. It shows that the concept is possible, for a demontration, artistic, or educational purposes, school learning course. Don't test in a real environment in production. 

 

Windows 11 v26100 Csharp First FPS building the level : last articles

 

 

how to install Godot engine

Windows 11 v23619 testing with a Unity game engine Hello World

How to use signals with Godo Engine (Red bouncing ball)

A Paddle Game with Godot engine

Windows 11 v26058 C Sharp with Copilot Godot Engine multiplayer client server POC

Windows 11 v26080 Blender installation

 

 

Windows 11 v26100 Csharp First FPS building the level : game design documents

 

Now, OS Windows 11 version 26100 is installed and ready, so i can test the middleware apps, frameworks...

Because « Game design theory is a large area of study and learning all its secrets can consume an entire career » before starting the project i need to limit the perimeter.

I must write the blueprint of the project on the game Design Document (GDD) and technical Design Document (TDD).

It's a POC, a prototype, so i go straigth to the point with minimum details.

Title: CsharpFirstFPS

Concept : stayling alive, ovoiding ennemies and collecting health items.

Gameplay: stay one step ahead of patrolling enemies and collecting required items. Combat will consist of shooting projectiles at enemies, which will automatically trigger an attack response.

Interface: movement with ZSQD or arrow keys and mouse for camera control. Shooting mechanic will use the space bar and item collection will work off of object collisions.

User interface: HUD will show
-items collected
-remaining ammo
-health bar

Art Style: primitive GameObjects

 

Windows 11 v26100 Csharp First FPS building the level : creating primitives 

 

With Unity, i can use
-basic 3D shapes to block out simple environments,
-the more advanced ProBuilder tool
Unity has a great introduction to the ProBuilder tool at: https://unity.com/features/probuilder
-I can even import 3D models from other programs, such as Blender, to use as objects in my scenes.
https://www.blender.org/features/modeling/

Building a level with Blender? ProBuilder tool?

Design, prototype, and play-test levels rapidly in the Unity Editor.

I found more about building Unity environments at: https://docs.unity3d.com/Manual/CreatingEnvironments.html

So, i launch Unity, it's already installed (else, see Windows 11 v23619 testing with a Unity game engine Hello World )

I click new project

Windows 11 26100 CsharpFirstFPS building the level new project

 

Project name : CharpFirstFPS . I choose 3D Core

 

Windows 11 26100 CsharpFirstFPS building the level 3d core

 

And i click Create project

I create a ground plane ( gameObject) so that we have a floor for the future character to walk around:

Hierarchy/ +/ 3D Object / plane

 

Windows 11 26100 CsharpFirstFPS building the level create ground plane

I rename it Ground in the inspector

I change scale to X=3,Y=3,Z=3

 

 

Windows 11 v26100 Csharp First FPS building the level : meterials

 

Now i need to change this GameObject properties like color and texture, so that the shader can render it onscreen.

I want to change the color of the ground to blue.

I create a new folder in the project panel : richt click/ create/ folder and i name it Materials

In the material folder, i right click, create/ material/ and name it Ground_Mat

Windows 11 26100 Csharp First FPS building the level material

I select this new material in the material folder and look at its properties in the Inspector

I click on the color box next to the Albedo property and select the blue color R:0 G:255 B:255

Windows 11 26100 CsharpFirstFPS building the level albedo color

 

I drag and drop the Ground_Mat object from the Project panel, onto the Ground GameObject in the hierarchy panel

The Ground GameObject is now filled with the blue color of the Ground_Mat object.

 

Windows 11 26100 Csharp First FPS building the level ground blue

 

That's enough for the ground. Because it is a "White-boxing" design, it is a design term for laying out ideas using placeholders, usually with the intent of replacing them with finished assets at a later date. 

 

Windows 11 v26100 Csharp First FPS building the level : the walls

 

Now i will wall in the arena so that the player as a confined locomotion arena.

I’ll create four walls

Hierarch > + > 3d Object > Cube

I name it wall_01

Inspector > Scale > x=30 ; y=1.5 ; Z=0.2

In the Scene tab, i position the wall on the edge of the ground plane.

I repeat those steps (or duplicate wall_01) to have 4 walls surrounding the ground plane area like this

 

Windows 11 26100 Csharp First FPS building the level the walls

 

I group the ground plane and the 4 walls in an empty game object, so that i can expand or close the environment object dropdown list :

Hierarchy/ + /create empty

I rename it from GameObject to Environment

 

Windows 11 26100 Csharp First FPS building the level group environment

 

 

I fix the Environment object’s X, Y, and Z positions to 0 because the child object

positions are now relative to the parent position. 

 

Windows 11 v26100 Csharp First FPS building the level : the turrets with prefabs

 

GameObjects that can be saved and reused with every child object, component, C# script, and property setting intact.

Now i must create 4 turrets on the map.

Under Environment parent object, Hierarchy/Environment/ +>create empty

I name it « Barrier »

Under Barrier parent object, I create 2 cubes, with +>3D objetcs>Cube

I create 2 other cubes to place them on top of the ends of the turret base

I adjust the Main camera with position Y=3, Z=-30

 

Windows 11 26100 Csharp First FPS building the level barrier prefab

 

In the Projects/Assets, i create a Prefabs folder

I drag and drop the Barrier Game Object in the Prefabs folder like this

Windows 11 26100 Csharp First FPS building the level barrier prefab asset

Now, Barrier is a « prefab asset ».

I update

Cube scale X3 to Cube scale X2

Cube scale X4 to Cube scale X3

I adjust the cubes.

I need ot add another cube to the Barrier so that the player can hide.

I create a the Cube center :

Under Barrier parent object, I create 1 cube, with +>3D objetcs>Cube

I rename it Cube center

Position X=2 ; Y=1

I right clic on this new cube, and « added Game Object », and « apply to prefab Barrier »

The Barrier prefab is updated :

 

Windows 11 26100 Csharp First FPS building the level prefab updated

 

I rename Barrier Barrier_01

I delete the Barrier prefab and create it again

Now i want to add 3 other barriers, in each corner of the arena.

I duplicate the Barrier Prefab 3 times :

Select Barrier, and Edit/Duplicate

I place each new Barrier prefab in each empty corner by drag and drop and rotate them (transform/rotation -90).

 

Windows 11 26100 Csharp First FPS building the level barrier prefab duplicated

 

Windows 11 v26100 Csharp First FPS building the level : the central platform

 

I create a new empty GameObject inside the Environment parent object, and name it Raised_Platform, and set its position in the x, y, and z axes to 0.

I create a Cube as a child object of Raised_Platform and scale it (x: 5, y: 2, z: 5) to form a platform

 

Windows 11 26100 Csharp First FPS building the level central platform

 

I create a Plane and scale it into a ramp (x: 10, y: 0.1, z: 5)

Scale X=0.5

Rotation : X=-15

I duplicate it 3 times to obtain the other ramps.

 

Windows 11 26100 Csharp First FPS building the level central platform ramps

 

 

Windows 11 v26100 Csharp First FPS building the level : conclusion done

 

Done! i created the project Csharp First FPS and built the level, the arena, on windows 11 version 26100.

Windows 11 26100 Csharp First FPS building the level

Windows 11 v26100 Csharp First FPS building the level : need help ?

 

Need help with Windows 11 or C# with Unity?

Fill this form or send an email on loic @consultingit.fr or This email address is being protected from spambots. You need JavaScript enabled to view it. and i will be happy to help you :)