Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1354510 Posts in 62616 Topics- by 54361 Members - Latest Member: tossenpro

January 19, 2019, 07:44:27 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsScraps: Modular Vehicle Combat - Vehicle combat with buildable vehicles
Pages: 1 ... 15 16 [17] 18 19
Print
Author Topic: Scraps: Modular Vehicle Combat - Vehicle combat with buildable vehicles  (Read 48380 times)
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #320 on: October 10, 2015, 01:49:06 PM »

And it's Weekly Game time today again later today: http://steamcommunity.com/games/350150/events/105063526136670299
As always it just depends on whether people feel like coming on for a game, so try coming on around that time if you're looking for some Scraps multiplayer.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #321 on: October 10, 2015, 07:01:20 PM »

Help, stuck in design hell trying to make buttons with icons that make sense.

I need three buttons:
- Big main button, repair and rebuild your vehicle as much as you can afford (background colour of the button will change depending on if you can fully afford it).
- Smaller button to just repair damaged parts (not replace totally destroyed ones).
- Another smaller button to just rebuild destroyed parts, but not repair damaged parts.

I like this one with vehicle silhouettes but I'm not sure how clear it is. And the silhouette at the top looks blah.



Maybe this one with icons is clearer, or maybe it's just more confusing:



Edit: Alt 3:



Edit 2: Another one:

« Last Edit: October 10, 2015, 08:14:03 PM by Nition » Logged

marcgfx
Level 6
*


if you don't comment, who will?


View Profile WWW
« Reply #322 on: October 11, 2015, 01:36:18 AM »

the last two options are the easiest to understand. I like the blow-torch, but the hammer is even more clear. likely the best choice.
the first two... much too complicated.
Logged

@falkenbrew
Mittens
Level 10
*****

.


View Profile WWW
« Reply #323 on: October 11, 2015, 01:48:31 AM »

the wrench and hammer design is the only choice
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #324 on: October 11, 2015, 12:09:31 PM »

Thanks people, I agree about the wrench/hammer combo. It's amazing how much it can help to just iterate on a design a few times (although it takes so much extra time as well!).
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #325 on: October 28, 2015, 06:25:50 PM »

Apologies or the lateness of this update.  I wasn't able to do Scraps work last week due to some real life events, and this week is going to be the same. Rather than having to push the next update way back, I've managed some time to clean up and release a smaller update today that still has the two major features I mentioned last time, plus a few other things as well.

Full changelog:
2015-10 - 0.5.2.9
- ## Added ability to rebuild as well as repair damaged vehicles while in-game.
- ## Wreckage pickup is easier, it kind of "attracts" towards you.
- Some general balance tweaks to wreckage.
- Improved the AI's weapon selection methods.
- Different sounds for each type of vehicle warning.
- Parts now sell for their purchase value, taking any wealth tax into account, so you never lose money.
- Increased steering speed for keyboard controls a little.
- Refreshing the server list clears the old list when it was user-prompted, just so it's more obvious that it's doing something.
- Updated Steamworks.NET and uLink versions.
Bug Fixes:
- Workaround for an issue in Steam where sometimes only the first two lobbies got returned.
- Spawn FX no longer show when creating existing vehicles as a player joins a game that's already in progress.
- Vehicle labels no longer show on top of loading screen dialogs.
- Fixed AI looking as if they repair right before they evac, instead of after.
- Fixed audio screeches and other silliness that sometimes occurred when entering maps.
- Fixed a bug with part costs and wealth tax when ctrl-placing parts.
- Fixed another bug with wealth tax when calculating estimated repair costs.


Rebuilding



You can now rebuild lost parts automagically after using evac pads (if you can afford it).

There are several ways this could work. As with my general philosophy for Scraps I've tried to balance functionality against complexity. At the moment it works like this:
  • Parts lost in-game count as ones to rebuild. Parts you manually remove on the Build Screen don't.
  • Removing a part on your vehicle on the Build Screen doesn't clear the rebuild list, but if parts in the rebuild list depended on that removed part, they'll fail to get added back. You won't be charged for those failed parts.
  • Adding a part to your vehicle on the Build Screen clears the rebuild list and sets the current vehicle as the "base" vehicle that'll be rebuilt to. This means you can build on your saved vehicle during a game and rebuild back to your temporarily improved one after you lose parts in battle, but it does also mean that adding a part when you have parts to rebuild will lose you that rebuild list. It's a compromise because once you start trying to handle these sort of branching trees of vehicle designs the complexity of the system skyrockets.


The Scraps Community

Just a note on the Scraps community in general: You guys are the best. While other people are complaining about their toxic game communities and "it broke plz fix" bug reports, Scraps players are sending me bug reports with a video of the bug happening. Recently I got a bug report that came with a suggested fix that was actually a good solution! In game dev circles that's usually accompanied by pigs flying.

It was so nice to come back after not being able to check up on the game for a few days to see three new super nice reviews (especially coming not too long after one that began with "honestly the worst game I have ever played..."). It's always especially cool to hear from people that have been following things since the early Builder Demo-only days. I know Scraps dev can be slow so I appreciate the people that keep checking back even more.
Logged

Stepan1010
Level 0
**


Developer of Icarus Starship Command Simulator


View Profile WWW
« Reply #326 on: October 28, 2015, 08:12:29 PM »

"Help, stuck in design hell trying to make buttons with icons that make sense."

Yea, the wrench and hammer are the most intuitive IMO. I don't know artistically which is better.

Your game looks really cool. It's good to see car battle games are still successful.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #327 on: November 02, 2015, 01:00:46 AM »

Technical post.

A long time ago Unity released a Car Tutorial that had some nice skidmarks for the car, but the skidmarks script did a whole bunch of unnecessary stuff and generated a ridiculous amount of garbage as it ran, causing the garbage collector to freak out about once a second and use about 25% of the CPU in the frame collecting a bunch of meshes. I had some skidmark code based on it in early versions of Scraps, but it had the same terrible garbage issues so I took it out rather than fix it at the time.

In the meantime I looked over a few other skidmark solutions but they all had issues of their own. For instance some were trail renderer-based and had the marks (all of them) disappearing as soon as the vehicle stopped skidding ("it's not a bug, it's a feature").

Recently someone contacted me to ask if I'd ever worked it out, and while I hadn't, we had some back and forth on it and he pointed out to me that it was possible to do it the original mesh-based way without generating so much garbage. Today I made that happen, so here it is, a modified version of the old Car Tutorial skidmarks that doesn't generate the garbage, doesn't count up numMarks forever, and doesn't do all that unnecessary mesh assignment in LateUpdate:

Code: (Skidmarks.cs)
using UnityEngine;

// Skidmarks texture. Only need one of these in a scene somewhere. Call AddSkidMark.
public class Skidmarks : MonoBehaviour {
    // INSPECTOR SETTINGS

    // Material for the skidmarks to use
    [SerializeField]
    Material skidmarksMaterial;

    // END INSPECTOR SETTINGS

    // Variables for each mark created. Needed to generate the correct mesh.
    class MarkSection {
        public Vector3 Pos = Vector3.zero;
        public Vector3 Normal = Vector3.zero;
        public Vector4 Tangent = Vector4.zero;
        public Vector3 Posl = Vector3.zero;
        public Vector3 Posr = Vector3.zero;
        public byte Intensity;
        public int LastIndex;
    };

    const int MAX_MARKS = 1024; // Max number of marks total for everyone together
    const float MARK_WIDTH = 0.35f; // Width of the skidmarks. Should match the width of the wheels
    const float GROUND_OFFSET = 0.02f;    // Distance above surface in metres
    const float MIN_DISTANCE = 1.0f; // Distance between points in metres. Bigger = more clunky, straight-line skidmarks
    const float MIN_SQR_DISTANCE = MIN_DISTANCE * MIN_DISTANCE;

    int markIndex;
    MarkSection[] skidmarks;
    Mesh marksMesh;
    MeshRenderer mr;
    MeshFilter mf;

    Vector3[] vertices;
    Vector3[] normals;
    Vector4[] tangents;
    Color32[] colors;
    Vector2[] uvs;
    int[] triangles;

    bool updated;
    bool haveSetBounds;

    // #### UNITY INTERNAL METHODS ####

    protected void Start() {
        skidmarks = new MarkSection[MAX_MARKS];
        for (int i = 0; i < MAX_MARKS; i++) {
            skidmarks[i] = new MarkSection();
        }

        mf = GetComponent();
        mr = GetComponent();
        if (mr == null) {
            mr = gameObject.AddComponent();
        }

        marksMesh = new Mesh();
        marksMesh.MarkDynamic();
        if (mf == null) {
            mf = gameObject.AddComponent();
        }
        mf.sharedMesh = marksMesh;

        vertices = new Vector3[MAX_MARKS * 4];
        normals = new Vector3[MAX_MARKS * 4];
        tangents = new Vector4[MAX_MARKS * 4];
        colors = new Color32[MAX_MARKS * 4];
        uvs = new Vector2[MAX_MARKS * 4];
        triangles = new int[MAX_MARKS * 6];

        mr.castShadows = false;
        mr.receiveShadows = false;
        mr.material = skidmarksMaterial;
        mr.useLightProbes = false;
    }

    protected void LateUpdate() {
        if (!updated) return;
        updated = false;

        // Reassign the mesh if it's changed this frame
        marksMesh.vertices = vertices;
        marksMesh.normals = normals;
        marksMesh.tangents = tangents;
        marksMesh.triangles = triangles;
        marksMesh.colors32 = colors;
        marksMesh.uv = uvs;

        if (!haveSetBounds) {
            // Could use RecalculateBounds here each frame instead, but it uses about 0.1-0.2ms each time.
            // Save time by just making the mesh bounds huge, so the skidmarks will always draw.
            // Not sure why I only need to do this once, yet can't do it in Start (it resets to zero).
            marksMesh.bounds = new Bounds(new Vector3(0, 0, 0), new Vector3(10000, 10000, 10000));
            haveSetBounds = true;
        }

        mf.sharedMesh = marksMesh;
    }

    // #### PUBLIC METHODS ####

    // Function called by the wheels that is skidding. Gathers all the information needed to
    // create the mesh later. Sets the intensity of the skidmark section b setting the alpha
    // of the vertex color.
    public int AddSkidMark(Vector3 pos, Vector3 normal, float intensity, int lastIndex) {
        if (intensity > 1) intensity = 1.0f;
        else if (intensity < 0) return -1; if (lastIndex > 0) {
            float sqrDistance = (pos - skidmarks[lastIndex].Pos).sqrMagnitude;
            if (sqrDistance < MIN_SQR_DISTANCE) return lastIndex;
        }

        MarkSection curSection = skidmarks[markIndex];

        curSection.Pos = pos + normal * GROUND_OFFSET;
        curSection.Normal = normal;
        curSection.Intensity = (byte)(intensity * 255f);
        curSection.LastIndex = lastIndex;

        if (lastIndex != -1) {
            MarkSection lastSection = skidmarks[lastIndex];
            Vector3 dir = (curSection.Pos - lastSection.Pos);
            Vector3 xDir = Vector3.Cross(dir, normal).normalized;

            curSection.Posl = curSection.Pos + xDir * MARK_WIDTH * 0.5f;
            curSection.Posr = curSection.Pos - xDir * MARK_WIDTH * 0.5f;
            curSection.Tangent = new Vector4(xDir.x, xDir.y, xDir.z, 1);

            if (lastSection.LastIndex == -1) {
                lastSection.Tangent = curSection.Tangent;
                lastSection.Posl = curSection.Pos + xDir * MARK_WIDTH * 0.5f;
                lastSection.Posr = curSection.Pos - xDir * MARK_WIDTH * 0.5f;
            }
        }

        UpdateSkidmarksMesh();

        int curIndex = markIndex;
        // Update circular index
        markIndex = ++markIndex % MAX_MARKS;

        return curIndex;
    }

    // #### PROTECTED/PRIVATE METHODS ####

    // Update part of the mesh for the current markIndex
    void UpdateSkidmarksMesh() {
        MarkSection curr = skidmarks[markIndex];

        // Nothing to connect to yet
        if (curr.LastIndex == -1) return;

        MarkSection last = skidmarks[curr.LastIndex];
        vertices[markIndex * 4 + 0] = last.Posl;
        vertices[markIndex * 4 + 1] = last.Posr;
        vertices[markIndex * 4 + 2] = curr.Posl;
        vertices[markIndex * 4 + 3] = curr.Posr;

        normals[markIndex * 4 + 0] = last.Normal;
        normals[markIndex * 4 + 1] = last.Normal;
        normals[markIndex * 4 + 2] = curr.Normal;
        normals[markIndex * 4 + 3] = curr.Normal;

        tangents[markIndex * 4 + 0] = last.Tangent;
        tangents[markIndex * 4 + 1] = last.Tangent;
        tangents[markIndex * 4 + 2] = curr.Tangent;
        tangents[markIndex * 4 + 3] = curr.Tangent;

        colors[markIndex * 4 + 0] = new Color32(0, 0, 0, last.Intensity);
        colors[markIndex * 4 + 1] = new Color32(0, 0, 0, last.Intensity);
        colors[markIndex * 4 + 2] = new Color32(0, 0, 0, curr.Intensity);
        colors[markIndex * 4 + 3] = new Color32(0, 0, 0, curr.Intensity);

        uvs[markIndex * 4 + 0] = new Vector2(0, 0);
        uvs[markIndex * 4 + 1] = new Vector2(1, 0);
        uvs[markIndex * 4 + 2] = new Vector2(0, 1);
        uvs[markIndex * 4 + 3] = new Vector2(1, 1);

        triangles[markIndex * 6 + 0] = markIndex * 4 + 0;
        triangles[markIndex * 6 + 2] = markIndex * 4 + 1;
        triangles[markIndex * 6 + 1] = markIndex * 4 + 2;

        triangles[markIndex * 6 + 3] = markIndex * 4 + 2;
        triangles[markIndex * 6 + 5] = markIndex * 4 + 1;
        triangles[markIndex * 6 + 4] = markIndex * 4 + 3;

        updated = true;
    }
}

Put that script anywhere in a scene. It needs a MeshFilter and MeshRenderer, but it'll generate them itself. You probably want your skidmarks material to have less than 100% alpha. I've uploaded just the shader from the Car Tutorial here.

Call AddSkidmark wherever you want them and keep track of the lastSkid, clearing it when you want them to stop: I'm using the GetGroundHit data from the wheels each FixedUpdate. You might want to adjust for the forward velocity of your vehicle so they don't look like they're generating just behind the wheels. Example usage:

Code: (Usage Example)
WheelHit wheelHitInfo;
if (wheelCollider.GetGroundHit(out wheelHitInfo)) {
    // Check sideways speed
    // Gives velocity with +Z being our forward axis
    Vector3 localVelocity = transform.InverseTransformDirection(rigidbody.velocity);
    float skidSpeed = Mathf.Abs(localVelocity.x);
    if (skidSpeed >= SKID_FX_SPEED) {
        // MAX_SKID_INTENSITY as a constant, m/s where skids are at full intensity
        float intensity = Mathf.Clamp01(skidSpeed / MAX_SKID_INTENSITY);
        Vector3 skidPoint = wheelHitInfo.point + (rigidbody.velocity * Time.fixedDeltaTime);
        lastSkid = Skidmarks.AddSkidMark(skidPoint, wheelHitInfo.normal, intensity, lastSkid);
    }
    else {
        lastSkid = -1;
    }
}


(smoke not included)

This'll be in the next Scraps update.
« Last Edit: November 02, 2015, 01:52:13 PM by Nition » Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #328 on: November 23, 2015, 06:16:32 PM »

Smallish update today:

2015-11 - 0.5.2.13
- AI is much, much less likely to follow you off a cliff
- Added top speed guess to the Build screen stats
- Performance: More efficient terrain rendering
- Reduced HP on Medium and Heavy cockpits
- Made heavy vehicles a little faster

You can now see a reasonable estimate of your vehicle's top speed in the build screen stats:


It'll show up in mph if you have that set instead.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #329 on: November 27, 2015, 06:56:02 PM »

Just a Scraps Weekly Game reminder.

A while ago a few people organised an unofficial "Weekly Game" where people would try to come onto Scraps multiplayer at the same time to play together. These have been going on for a while now and they're sometimes more popular than others, but if you're looking for people to play against, coming on at one of these times is probably your best bet:

There's no official server to join - either people join one of my official ones or they create their own with custom settings. Again these are just unofficial things - no guarantees of attendance - but

.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #330 on: December 02, 2015, 04:57:57 PM »

Here's a bit of a look back at three years of Scraps development: http://www.scrapsgame.com/three-years-of-scraps-development
« Last Edit: December 03, 2015, 12:33:13 PM by Nition » Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #331 on: December 20, 2015, 12:11:32 PM »

Scraps v0.5.2.15

This update is mainly lots of bug fixing and code cleanup behind the scenes. I also did a smaller v0.5.2.14 update that I didn't make an update post for earlier, which improved CPU performance.

The specifics:

2015-12 - 0.5.2.15
- Added heavy armour part
- Better support for XBox 360 controller on Mac and Linux. Separate default key bindings keep actual inputs the same on all platforms
- Engine sounds with multiple of the same engine work together better
- Removed an annoying ridge in the RiverRift terrain
- Added some subtle fades between scenes
Bug Fixes:
- Fixed occasionally coming back from testing vehicles to the build screen and your vehicle has flown off into space somewhere
- Removed more false positives and not-really-bad words from the swear filter
- "Open save folder" button now working on Linux
- Fixed the loading screen getting stuck if your vehicle spawned in right as a round ended
- Fixed visual glitch between light beams and edge wall glass
- Fixed screen staying white if your vehicle was destroyed right at the moment of evac completion
- Fixed game modifiers (low gravity) not being unapplied on connected clients if the server shut down
- Fixed SkinnedMeshRenderer errors being generated in-game (in the background) if a vehicle had no moving parts
- Lots of refactoring and fixing issues with chassis, propulsion systems and their hit points and other values
- Tooltips for chassis select now include the extra HP gained from the wheels (so they show the actual full chassis HP now)

2015-12 - 0.5.2.14
- CPU performance improvements due to physics and rendering optimisation work
- Tweaks to the RiverRift map layout
- Swedish translation update

Have a good Christmas everyone. Thanks everyone who reported bugs that are fixed here.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #332 on: January 23, 2016, 11:45:55 PM »

It's been a bit longer than usual since the last Scraps update, so I just want to give some reassurance that I'm still working hard on things. There was a little time off over Christmas and New Years, but recently I'm working on something that I've alluded to a little in the past: A major new single-player game mode. My thoughts are that it should help a lot to flesh out the game content whether or not Internet multiplayer numbers pick up. I won't go into details of how it'll play just yet because I'm still testing things out myself, but I will in the near future. I think it'll be a lot of fun.

The new mode is pretty major, and is going to take several months to finish completely. I'll attempt to get some stuff out to try earlier, but I'll also keep doing some smaller game updates in the meantime regardless. The next game update will be next weekend but it'll be mostly bug fixes and minor improvements. Still, things are happening, and I'll have more to show soon.
« Last Edit: January 24, 2016, 12:24:02 AM by Nition » Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #333 on: January 31, 2016, 12:58:31 AM »

The latest Scraps release is again focused on fixing bugs and generally making the core game better. In the background I've also been working on the new Singleplayer mode, but that's not ready to show off just yet.

0.5.3.0
- More efficient shader/material usage for environmental stuff
- Bigger shockwaves move faster (just looks better)
- Some new destruction FX
- Fixed some lightmapping glitches and improved some normal maps on terrain
- Added some new stuff on the test map that I've been creating for the upcoming singleplayer game mode
- Using the lowpassed music track in the lobby instead of the full one, it's more chill
- Added an additional vertical adapter block
Bug Fixes:
- Fixed multiple issues where games could get stuck at Dropship In Transit when starting games. Please let me know if this happens to you after this update
- Fixed AI sometimes being lazy and just hanging out until being destroyed for the first time, causing it to henceforth spring into life
- Fixed game start failing if scrap limit was changed lower, then deploy clicked right away, causing the limit to lower and make a vehicle selection invalid
- Fixed some incorrect cube weights on the Test Map
- Fixed shockwaves sometimes not showing up when they should

Two Dropship In Transit bugs - one that happened on going from menu to lobby, and the other while going from lobby to game - were horrible timing bugs that only occurred when the stars were aligned just right. The issues I found are definitely fixed now, but please let me know if you still get stuck at a loading screen in the future. Of course, report any bugs you find - I do try to fix things!
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #334 on: February 03, 2016, 04:46:14 PM »

0.5.3.1

Today's Scraps update doesn't change anything exactly, but the install size of the game is now almost half what it was!

Basically there was a lot of duplication between the main game and server components. This was OK when the game was very small anyway, but it's been getting steadily bigger, so I've refactored things so there's no separate server app at all anymore. Now a server is just the main game with a server flag passed in, and all the duplication is gone. You can still host a game and play on it at the same time.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #335 on: February 23, 2016, 02:06:46 PM »

The last couple of weeks of dev have been a bit frustrating. I came up against an engine feature that I wanted which - my mistake - I had thought was in Unity 4 but was actually only introduced in Unity 5. Scraps has been halfway converted to Unity 5 for a while so I did a bit more on that conversion, tested the stuff I needed, and realised it still wasn't going to work anyway. Not a real loss of time because I'll most likely need to move the game from Unity 4 to 5 eventually anyway, but annoying because I want to get new content out as much as the next person.

I can actually show some work on content rather than code for once though. You may have seen the new pile of crates and barrels on the Test Map in the last update:



In the editor the crates look like the left image, but when the game is run they take on some random colour variation to look a little more interesting. Giving them all different Materials with different tints would blow out the amount of draw calls in the scene, so instead they all share the same Material, and the tint colour is set via the vertex colour on the mesh itself. Pretty simple code:

Code:
void SetTint(Mesh mesh) {
// Tint is set via mesh vertex data rather than in the shader properties,
// so that we can still use the same shared single material instance on everything!
 
byte colour255 = (byte)(Random.value * 255);
 
Color32[] colors = mesh.colors32;
for (int j = 0; j < colors.Length; j++) {
colors[j].b = colour255; // Setting the blue channel
}
mesh.colors32 = colors;
}

The meshes are simple so running through the array is super fast - but it only runs once on level load anyway. Then in the surface shader I use the blue vertex's blue colour channel value to do whatever - it's really just a way of getting information from the game to the shader.

Code:
// Any extra tint stored in BLUE channel
// fmod is % (mod). Using it to map all possible RGB values
float4 tint = 0.7 + float4(IN.color.b, fmod(IN.color.b * 2, 1), fmod(IN.color.b * 4, 1), 1) * 0.3;
if (IN.color.b > 0) {
c.rgb *= tint;
}

You may wonder why I set just the blue channel and then calculate a colour tint based on that rather than setting the whole vertex colour RGB and setting the tint to that value.

The reason is that a lot of things in Scraps are actually done this way - heat effects on vehicle parts, damage texturing on everything, and how shiny vehicle parts are (specularity) are all specified by modifying the different colour channels in the mesh vertex data, so that each vehicle can be shown with one Material and the environment can be drawn with another. So I need the red and green channels for other things. Otherwise every time something got damaged or heated up, it'd have to use its own Material and have its own draw calls, making graphics performance a lot worse.



I also made these barrels. The red one explodes of course. I wrote a generic script that I can attach to any world object to make it explode when destroyed and damage surrounding stuff.



Driving a vehicle by ScrapsEnthusiast there. Yesterday I also added subtle air control to the game, so that'll be in the next update. It's tuned more for gameplay than being realistic, but you can at least pretend it's created from the torque of the wheels spinning in the air.



And I made some light beam/forcefield-style walls that I can use to create more subtle level borders for some levels. Functionally they work the same as the current walls.



For the next game mode I need lots of terrain, so I've been improving my terrain creation workflow. I can now take a basic low-detail terrain and put it through my Scraps-specific World Machine setup to get out a terrain fairly quickly with erosion and varied texturing.



OK, the bottom one still doesn't look amazing yet, but that's without any grass, fog, sky, etc etc. It's a lot better than the top one considering the minimal manual effort involved. One thing that's not obvious in the screenshot is that the "after" terrains also have more fine detail - so I can map out a fairly low-res base terrain and then run erosion on it to make it into a more fully detailed one.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #336 on: March 14, 2016, 08:24:04 PM »

The latest Scraps update adds a little air control, a save format upgrade, tweaked weapon hit forces, and a terrain graphics upgrade.

Full changelog:

2016-3 - 0.5.4.0
- Terrain graphics upgrade. But no more switching to greyscale terrain when in low grav mode I'm afraid
- Magically, vehicle save files are now also PNG image screenshots of the vehicle itself
- Separated weapon recoil and hit force, so they don't have to be the same anymore. Reduced hit forces in general - should help with Medium Cannon spam in particular
- Rewrote the weapon movement range calculation AGAIN. More bugs fixed with it. Hopefully very correct and consistent now
- Added a little air control: Pitch = Throttle forward/back. Roll = Throttle + Steering. More engine power gives more control
- Finally the test map side road is actually 100% flat, right up to the ramp
- Updated uLink and Steamworks.NET to their latest versions
- Added grass density graphics option
Bug Fixes:
- Tooltips now update their text to match language changes without requiring a restart
- Fixed mass from held wreckage not being subtracted after wreckage was offloaded on evac
- Stopped evac pad ambient sound from playing when the pad is turned off (Test map)

Air control


I showed this off in the last update, but now it's live. You can control your pitch with throttle and your roll with turning. You can't control yaw - it's a car, not a plane OK? Practising in Low Gravity mode is a nice way to get the hang of it.

Recoil
Weapon recoil and hit forces used to always be the same, which was arguably more realistic, but it meant that if I wanted a big kick on a weapon it also had to have a big hit. Often because of hit angles and multiple shots hitting in one spot, the hits would end up even worse than the recoil.

I've changed it so that I can set them separately, and reduced some hit forces. Hopefully there's less of a problem with Medium Cannons and Plasma in particular throwing vehicles around now. Of course you can still push your enemies around to some extent.

Save Format


Those are actual save files. When you save vehicles now they'll end up in a new format, which is also a png image - so now it's easier to see what a vehicle is if you're sharing it around.

The easiest way to see your vehicle saves is probably to open the Save/Load dialog in the game and click the button at the top right which takes you straight there.

Hosting these on an image host will most likely break them - you can try, but you're probably better off using a file host of some sort. Anything that won't try to modify or re-encode the image file.

Dev note: There are several ways to do something like this. Gimbal has awesome image saves, as does the Spore creature creator. One potential method is to use the image's metadata fields to add your custom data, although sometimes those have size limits. Another method is to use something in the image itself that's invisible or hard to see, like something in the alpha channel or the least significant bits. Or even just extend the image to have the data encoded in an extra part of it, using all the available colour data.

However, I've done this with the dumbest and simplest method possible: Just dumping all the save data at the end of the file! It was one of the options I've read about so it's not totally unheard of. Sure image hosts will probably break it but all those other methods get broken by image hosts anyway. Seems like as long as you still end the png part of the file properly (works for JPEG too!), every PNG reader that I've come across reads the files with no problem. Scraps just ignores the image part and looks for my special marker, then starts reading the save from there.

Graphics
Scraps' terrain graphics have always been pretty meh, and I wanted to get a better system for new stuff, so I've also back-ported that to the existing maps.





What's actually better? Well, there's nice perlin shadowing on things (how much there is varies with the terrain texture):



Although I had to get rid of the black outline FX on terrain.

Bumpy stuff is... bumpier:



And you can see there that the grass is better too, not just denser. The default Unity grass shader is a simple cutout thing: It takes a texture and says OK, if the alpha value is above whatever, I'll show that pixel, otherwise I won't show it. That gives really crisp but jagged looking grass. It also means that when the terrain engine tries to fade out distant grass, instead of getting semi-transparent grass you get grass that sort of gets cut down more and more at the edges.

I did a literally one-minute edit to the grass shader to make it do "proper" transparency, and the difference is huge!



I don't think Unity has updated their grass shader for a long time. There's a comment about Mac OS 10.4 in there. I was sure I must've killed performance as a tradeoff, but if anything the grass performance seems to be slightly better. Here's my replacement WavingGrass.shader and WavingGrassBillboard.shader if any Unity devs want them, it's like jumping from 2002 to 2012 in one fell swoop.

There's also now texture blending based on heightmaps:



What's happening above is, when there's a mixture of two different terrain textures, it used to just blend, but now it'll show the higher parts of the texture first (based on a greyscale height map I supply it), so the new texture sort if "raises up" out of the other one as it increases in opacity. For Unity devs, most of these new features come from using Tomasz Stobierski's Relief Terrain Pack (it's not exactly drop-in-and-your-terrain-looks-amazing, but it is very good once you bend it to your will).

I also wrote some custom terrain editing tools of my own to let me make stuff faster:



The heightmaps and splatmaps (texture layout) used there are pre-created - my tools aren't that amazing - but it automates a whole bunch of stuff that was previously tedious. It also means I can edit heightmaps and splats and basically just click to update. Without much more work a terrain like the one above starts looking pretty good:



Still working on a new single-player mode.

 
« Last Edit: March 14, 2016, 08:39:04 PM by Nition » Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #337 on: March 20, 2016, 11:42:31 AM »

- Main Menu layout changes
- AI players now show in the server info
- If an AI player gets kicked from a game by a human player joining with no free slots, when a slot is free again they'll now come back... for revenge
Bug Fixes:
- Fixed rotation range calc bug
- Fixed "aim sphere" rotation range visual bug
- Fixed null reference exception that occurred on dedicated servers in no-GUI mode with the new terrain
- Fixed music player playing the wrong track if the track was changed and then changed back to the original track while the original track was still fading out

The main menu looks different, but it's actually the same functionally. The main aim is just to sort of encourage starting games that other people can join, but it also makes room for introducing a new game mode later.

Equivalents:

Playing single-player:
Old: Singleplayer
New: Play->Start A Game, have "Allow other players to join" unticked.

Joining an Internet game:
Old: Multiplayer->Internet->Join A Game
New: Play->Join A Game

Joining a LAN game:
Old: Multiplayer->LAN->Join A Game
New: Play->Join A Game, select the LAN tab

Hosting an Internet game:
Old: Multiplayer->Internet->Host A Game
New: Play->Start A Game, have "Allow other players to join" ticked, and set to Internet

Joining a LAN game:
Old: Multiplayer->LAN->Host A Game
New: Play->Start A Game, have "Allow other players to join" ticked, and set to LAN

"Allow other players to join" is ticked by default, but it remembers what you last set, so if you always play Singleplayer for instance it'll stay unticked once you've set it that way.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #338 on: March 29, 2016, 01:18:30 AM »

I just wanted to do a small fix-up update today to tidy some things up:

2016-3 - 0.5.4.2
- Some performance improvements, mainly on CPU (the previous terrain graphics upgrade made CPU performance worse)
- Added some grungy texture to scene objects in general
- No more lag spike (one-frame FPS drop) the first time wreckage spawns
- Added a little help dialog thing when first playing a game to point out adding AI players
- Added hover tooltips to the server list that show the full game name, in case it doesn't fit
Bug Fixes:
- Got rid of grass growing through evac pads on the test map
- Missing button click sounds added to lobby screen
- Fixed AI info in the server list going away after 30 mins when the lobby refreshed

By the way, I'm also aware that running the game in DirectX 9 mode (if you don't have a DirectX 11 compatible graphics card) at the moment causes some issues with how the terrain looks. I'm looking into it.
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #339 on: April 09, 2016, 10:37:12 PM »

Super secret new content preview, #1/10.

Logged

Pages: 1 ... 15 16 [17] 18 19
Print
Jump to:  

Theme orange-lt created by panic