[QUOTE=sarge997;44019517]I seem to have been late to the party, it says the video Garry posted is corrupt?
Mind telling me what it was?[/QUOTE]
Top-down camera selection of units with pathfinding for the selected group. The units moved to where you clicked on the map, like an RTS. The units in this particular case would automatically shoot at enemies if they were close. The enemies were piles of green goo that would constantly duplicating itself and expanding down corridors on the map. Garry controlled the units in groups to destroy the goo balls.
[QUOTE=Asgard;44019456]Would you mind sharing the Point and Click scripts?[/QUOTE]
Sure, here you go:
[url]https://dl.dropboxusercontent.com/u/3590255/Bits/PointAndClick.zip[/url]
Oh you need this somewhere too:
[code]using UnityEngine;
using System.Collections;
namespace Tools
{
public static class CollisionTest
{
//
// WHAT? Converts a screen rect into projected corners
// WHY? To create bounding planes, or to measure an object in world space?
//
public static Vector3[] GetWorldCorners( Rect screenRect, Camera camera, float fDistance = 1024.0f )
{
var corners = new Vector3[4];
corners[0] = camera.ScreenToWorldPoint( new Vector3( screenRect.x, screenRect.y, fDistance ) );
corners[1] = camera.ScreenToWorldPoint( new Vector3( screenRect.x + screenRect.width, screenRect.y, fDistance ) );
corners[2] = camera.ScreenToWorldPoint( new Vector3( screenRect.x + screenRect.width, screenRect.y + screenRect.height, fDistance ) );
corners[3] = camera.ScreenToWorldPoint( new Vector3( screenRect.x, screenRect.y + screenRect.height, fDistance ) );
return corners;
}
//
// WHAT? Given 4 world 'corners' and a camera, creates 4 bounding planes
// WHY? So we can test whether colliders are inside rectangle on a camera
//
public static Plane[] GetPlanesFromCorners( Vector3[] corners, Camera camera )
{
Plane[] planes = new Plane[4];
if ( camera.isOrthoGraphic )
{
var vForward = camera.transform.forward * -1024.0f;
planes[0].Set3Points( corners[3] + vForward, corners[3], corners[0] );
planes[1].Set3Points( corners[1] + vForward, corners[1], corners[2] );
planes[2].Set3Points( corners[0] + vForward, corners[0], corners[1] );
planes[3].Set3Points( corners[2] + vForward, corners[2], corners[3] );
}
else
{
planes[0].Set3Points( camera.transform.position, corners[3], corners[0] );
planes[1].Set3Points( camera.transform.position, corners[1], corners[2] );
planes[2].Set3Points( camera.transform.position, corners[0], corners[1] );
planes[3].Set3Points( camera.transform.position, corners[2], corners[3] );
}
return planes;
}
//
// WHAT? Given a bunch of colliders, a screen rect and a camera will return all those colliders inside that rect
// WHY? You'll have gotten the colliders from a fast test like a OverlapSphere, then be eliminating those that aren't in a rect
//
public static Collider[] GetCollidersInFrustum( Collider[] colliders, Rect screenRect, Camera camera )
{
//
// Convert each corner into a world space vector
//
var vecCorners = GetWorldCorners( screenRect, camera );
//
// Create a bunch of planes
//
var planes = GetPlanesFromCorners( vecCorners, camera );
//
// Check each collider against the planes
//
System.Collections.Generic.List<Collider> passlist = new System.Collections.Generic.List<Collider>();
foreach ( var collider in colliders )
{
if ( !GeometryUtility.TestPlanesAABB( planes, collider.bounds ) ) continue;
passlist.Add( collider );
}
return passlist.ToArray();
}
}
}[/code]
[QUOTE=sarge997;44019517]I seem to have been late to the party, it says the video Garry posted is corrupt?
Mind telling me what it was?[/QUOTE]
It was a game. You had like 10 npcs and they were moving where you were clicking on the map.
And there was like a... Something like a jelly that was spreading and the NPCs were destroying it.
[editline]23rd February 2014[/editline]
Shit I am late -_-
If I want to make a MiniMap.
I know there is a way using the camera but I don't really want to use that.
If I want to make it look like this, would I the map drawn and then it changes position based on the player position ?
[img]http://extreme.pcgameshardware.de/attachments/292212d1291920387-gta-4-minimap-grafikbug-untitled-1.jpg[/img]
If your mini map doesn't change, like in GTA then all you need to do is have the image sections already made and then scroll it in that circle section, that's literally all there is to it.
Gomna start making a 3D puzzle game tonight hopefully. Have some pretty decent concepts thought up right now. Will show later on.
[QUOTE=layla;44026340]If your mini map doesn't change, like in GTA then all you need to do is have the image sections already made and then scroll it in that circle section, that's literally all there is to it.[/QUOTE]
What do you mean by "doesn't change" ??
what he means if that if the images for the minimap dont change, ie an explosion happens and the minimap changes
[QUOTE=BoowmanTech;44026496]What do you mean by "doesn't change" ??[/QUOTE]
In GTA games the mini map images have already been made, they aren't drawn on the fly.
Oh, never mind I misread your first post.
[editline]24th February 2014[/editline]
Basically it's just a scrolling image.
[thumb]http://files.1337upload.net/progress_10.png[/thumb]
Got texture coordinates and lights working in the VMF importer. The brightness values are still a bit off, but they can be easily tweaked.
[editline]24th February 2014[/editline]
Oh, and that's just point lights and spots. No ambient lighting yet.
Nice, does it import all light settings from VMF? And how does the object grouping works from the imported brushes (I assume that's what the seen group objects are for)?
Question about creating a map.
I know in Hammer to create a building or things like that I would've used the shapes from the engine because I couldn't use models because they were glitchy.
So in Unity when creating a map the building and everything that's on the map except the terrain are models ?
[QUOTE=BoowmanTech;44030034]Question about creating a map.
I know in Hammer to create a building or things like that I would've used the shapes from the engine because I couldn't use models because they were glitchy.
So in Unity when creating a map the building and everything that's on the map except the terrain are models ?[/QUOTE]
You usually bake everything into meshes.
Also check out probuilder which I find is better than the hammer controls
[url]https://www.youtube.com/watch?v=0P2tsxSLz4U[/url]
The one thing I dislike about unity is that it makes it difficult to have external game files, it packs everything into some proprietary format. I know they do that to make it easier to build for multiple platforms but what are my options if I want all my game files in the executable directory so modders can add or remove anything they want?
[QUOTE=layla;44030200]The one thing I dislike about unity is that it makes it difficult to have external game files, it packs everything into some proprietary format. I know they do that to make it easier to build for multiple platforms but what are my options if I want all my game files in the executable directory so modders can add or remove anything they want?[/QUOTE]
You can load things manually from disk - like any other engine. Loading I guess is the issue, but I guess with something like VMF you're using all your own loaders anyway - so it shouldn't be a problem.
[QUOTE=AtomiCal;44030124]You usually bake everything into meshes.
Also check out probuilder which I find is better than the hammer controls
[url]https://www.youtube.com/watch?v=0P2tsxSLz4U[/url][/QUOTE]
Right now I don't want to spend money on anything.
I just wanted to know how are maps usually created. Using models as enter-able buildings and other things like that.
[QUOTE=layla;44030200]The one thing I dislike about unity is that it makes it difficult to have external game files, it packs everything into some proprietary format. I know they do that to make it easier to build for multiple platforms but what are my options if I want all my game files in the executable directory so modders can add or remove anything they want?[/QUOTE]
I don't know of any plugins that can do this, but I have an idea on how it could be done.
Create a data folder and index everything using the [URL="http://msdn.microsoft.com/en-us/library/system.io.directory(v=vs.110).aspx"]directory[/URL] class.
Load and use files on map load using the [URL="https://docs.unity3d.com/Documentation/ScriptReference/WWW.html"]WWW[/URL] class in unity.
Optionally generate precache file lists.
[QUOTE=BoowmanTech;44030268]Right now I don't want to spend money on anything.
I just wanted to know how are maps usually created. Using models as enter-able buildings and other things like that.[/QUOTE]
you pretty much use models
[QUOTE=BoowmanTech;44030268]Right now I don't want to spend money on anything.
I just wanted to know how are maps usually created. Using models as enter-able buildings and other things like that.[/QUOTE]
You set up the whole scene by placing models, setting their collisions and such.
I'm just curios on how nobody was trying to port anything Source to Unity before the recent Dear Esther Unity port. At least none that I'm aware of.
[QUOTE=atrblizzard;44030434]You set up the whole scene by placing models, setting their collisions and such.
I'm just curios on how nobody was trying to port anything Source to Unity before the recent Dear Esther Unity port. At least none that I'm aware of.[/QUOTE]
Dear Esther got ported to unity?
It's been on works for about two months, most assets are already ported except for a few things. You can find more about it here: [URL]http://www.littlelostpoly.co.uk/dear-esther-and-unity/[/URL]
I honestly never thought it could look as good as on Source though. Although there's a lot more to do before it's fully [URL="http://www.littlelostpoly.co.uk/dear-esther-unity-how/"]ported[/URL].
Alright I got the map loading from disk, only problem is that I have to have a copy of the file in Assets/ and _Data/ so it works in both the editor and game. I guess I can live with that. I'm using this to find the path [url]http://docs.unity3d.com/Documentation/ScriptReference/Application-dataPath.html[/url]
I guess I could adjust the path based on platform but that's obviously not a very good solution.
[QUOTE=atrblizzard;44029605]Nice, does it import all light settings from VMF? And how does the object grouping works from the imported brushes (I assume that's what the seen group objects are for)?[/QUOTE]
I wrote the light importer: It supports spot and point lights. Brightness, colour and spot cone angle are the only settings currently supported.
[QUOTE=layla;44030768]Alright I got the map loading from disk, only problem is that I have to have a copy of the file in Assets/ and _Data/ so it works in both the editor and game. I guess I can live with that. I'm using this to find the path [url]http://docs.unity3d.com/Documentation/ScriptReference/Application-dataPath.html[/url]
I guess I could adjust the path based on platform but that's obviously not a very good solution.[/QUOTE]
You could probably just do #if UNITY_EDITOR instead of copying files :0
Yeah that's one way but it's still a bit tricky to get back into the game_Data folder. I'd have to hardcode the name of that folder.
What I've done for now is use this path
Application.dataPath + "/../Maps/" + mapName + ".bsp"
That's going to reach the same path on both editor and windows, the only 2 places I care about right now anyway. I suppose this is why they pack everything into their own file.
This is a game that I made in an hour or so yesterday. The controls are WASD to move and the mouse to look around.
[unity]
http://dooskington.com/data/vidja/Web.unity3d
[/unity]
EDIT:
I can't get the unity embed to work, here is the link
[url]http://dooskington.com/data/vidja/Web.html[/url]
[QUOTE=Simspelaaja;44030787]I wrote the light importer: It supports spot and point lights. Brightness, colour and spot cone angle are the only settings currently supported.[/QUOTE]
There aren't many options for Unity, like constant, linear and quadratic. But with the right settings you should get the same results. And I assume the transform positions are also being kept at import. The current VMF Importer for Maya gets the rotations wrong for them.
[QUOTE=atrblizzard;44033600]There aren't many options for Unity, like constant, linear and quadratic. But with the right settings you should get the same results. And I assume the transform positions are also being kept at import. The current VMF Importer for Maya gets the rotations wrong for them.[/QUOTE]
Yeah, positions and angles are converted. We had a bug with rotation for a day or so, but we managed to fix it.
Anyone got any tips on texturing? It seems like black magic and has really put me off using unity because I can't texture any models.
Sorry, you need to Log In to post a reply to this thread.