Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411428 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 01:46:45 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsScraps: Modular Vehicle Combat - Vehicle combat with buildable vehicles
Pages: 1 2 3 [4] 5 6 ... 20
Print
Author Topic: Scraps: Modular Vehicle Combat - Vehicle combat with buildable vehicles  (Read 63903 times)
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #60 on: March 13, 2013, 11:48:21 AM »

It's coming.
Logged
Malloy
Level 0
**

Feeka


View Profile
« Reply #61 on: March 18, 2013, 09:05:35 AM »

Where is an update bro Tongue had to find this badboy on page 6!
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #62 on: March 18, 2013, 11:45:36 AM »

I'm always working on something for it, even if I'm not posting. Thanks for your interest. Beer!

I've been getting it working so that you can go from the game screen back to the build screen without everything messing up (previously you could only go build->game but not back), and actually putting in pause menus and stuff, plus fixing some bugs.

Oh, and I started on a music track for the menus etc.

Now I'm going to work on saving and loading vehicles, which is long overdue.
« Last Edit: March 18, 2013, 11:53:57 AM by Nition » Logged
Malloy
Level 0
**

Feeka


View Profile
« Reply #63 on: March 18, 2013, 12:08:35 PM »

Awesome man! Thanks for the update!

Sorry if this is previously stated but is there ambition for multiplayer/blueprint trading?

That would be amazing!
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #64 on: March 18, 2013, 12:11:48 PM »

Yes to both. In fact there won't really be single player campaign or anything, at least not at first, just multiplayer or playing against bots. Blueprint trading I'm going to work on at the same time as saving/loading.
« Last Edit: December 21, 2013, 06:40:10 PM by Nition » Logged
Malloy
Level 0
**

Feeka


View Profile
« Reply #65 on: March 18, 2013, 01:44:56 PM »

May I suggest an arena making tool similar to Halo's 'Forge' mode? That would be a killer addition!

Cool man, look forward to the next update!
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #66 on: March 24, 2013, 07:56:19 PM »

You can now save and load vehicles:



Each save file is small – it doesn’t serialise the whole vehicle object, just saves the relevant information. A .scraps vehicle file is only a few kilobytes and is intended to be easy to share.

I also attempted to do a system like Spore or Gimbal use, where the save data is actually embedded into a screenshot of the vehicle. In Spore it’s stored in the RGB values of the transparent pixels, and in Gimbal I believe it’s stored as metadata. It’s such a cool system because not only does it make it easy to see exactly what you’re getting, it also makes it super easy to share anywhere – even on forums that don’t allow uploading files.

Unfortunately it seems pretty hard to do via Unity (or more specifically, Mono). I can take a screenshot fine and save that. I ran up against a wall trying to embed metadata since Mono doesn’t have the .NET  System.Windows classes which include all the metadata handling methods, plus Scraps needs to work on Mac or Linux as well anyway. There’s probably some way to do it but it was going to take too long to work out, so unfortunately the same files are just files – for now at least.

Certainly it’s possible to go the hide-the-data-in-the-image method (sort of steganography), using the alpha channel, least significant bits etc. But I’m not that keen on it because I’ll have to have lots of checks to make sure the vehicle data always fits. Eventually, if your vehicle was super complex, corruption in the image would become unavoidably visible. I’d much rather go the metadata route where I can just throw all the code in as actual text.
Logged
TNERB
Level 5
*****


gamez stink


View Profile WWW
« Reply #67 on: March 24, 2013, 08:20:38 PM »

Diggin that logo, I can't wait to get my hands dirty and build up some vehicles
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #68 on: April 29, 2013, 01:20:49 PM »

I am still alive by the way, and Scraps is still in progress. I've been away for three weeks so there was a gap in development, but just before I went away I got the basics of sound working which I'll give details on soon.

I also discovered that there are some graphics and performance issues which appear on some lower-specced machines, so I'm looking at those at the moment because I want to get everything that's there running smoothly before I add any more.
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #69 on: May 02, 2013, 02:29:30 AM »

I've just put up a big post and video about the audio implementation. To get all the formatting etc, it'll be best to just link to it rather than copying it here: http://www.scrapsgame.com/sound-in-scraps

Here's the video itself:

« Last Edit: May 02, 2013, 12:36:20 PM by Nition » Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #70 on: May 02, 2013, 12:36:28 PM »

I also just fixed a bug in the aiming system so now you can put weapons facing every which way, having them all active at once, and aim all of them correctly. So you can do stuff like this and it actually works properly:



Note that as I move the cross hair around, the active guns all try to aim at it, so I can move to the side and aim those weapons, then move to aim at the front, etc. Making progress!
Logged
Johnyliltoe
Level 0
*


View Profile
« Reply #71 on: May 02, 2013, 01:41:57 PM »

Hazzah! My let's Play is finally finished. It's split into 4 parts, so here's the playlist:

https://www.youtube.com/playlist?list=PLoN9hgE6w-Rm7Nlh9KJfYh-XtXNK06KLG
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #72 on: May 02, 2013, 02:52:31 PM »

Wrong thread, Johnyliltoe.

I checked out the free version of Gear Up on Steam today, because from their blurb it sounds a lot like Scraps:
Gear Up is a multiplayer game where you can build tanks and participate in online challenges such as battles, races and missions. We have created lots of weapons, turrets, chassis and tracks, all ready to be assembled with each other. Thousands of different tanks can be created and if you think wheels and tracks are boring try the spider legs, the hoovers or the wings.

It looks kind of cool but it's not really what I want. The customisation is just selecting one part from each of five or six categories. You can't create anything really unexpected or ingenious or terrible. Almost every part is locked in the free version so I couldn't do much anyway, and then when I tried to enter a game, the application crashed.

If you like the idea of Scraps you guys should check out Rawbots though. It's sort of like a cross between Scraps and Roboforge.
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #73 on: May 06, 2013, 07:54:02 PM »

This post will act as both a DevLog entry and, hopefully, some small help to people trying to get Unity's black-box dynamic batching working.

Scraps as it is right now performs fantastically on my Desktop machine with a Radeon 7850, pulling over 300fps. It performs pretty poorly on my four-year-old laptop with a GeForce 9400M, where I have to cut the graphics settings to get 50fps.*Now, it's a fairly old machine, but Scraps is a pretty basic-looking game right now, and if the thing can run Portal 2 on low settings, it sure should be able to run Scraps without turning the graphics way down. Plus, a vehicle can have any number of parts, increasing the amount of things to render indefinitely.

One of the big issues with Scraps is the number of draw calls. Well, it's not a big issue yet, but I can see it's going to be, because when you build a vehicle out of lots of*separate*parts - parts that can come off again or be added to - it's necessarily made up of lots of separate meshes. And separate meshes usually mean more draw calls. And more draw calls always means more CPU (yeah,*CPU) time.

Now, it's possible to coax *Unity into dynamically batching multiple meshes into a single draw call if you fulfill a bunch of somewhat esoteric criteria. The draw call page in the manual has a list under "Tips", but it turns out that it's not the whole list.

One big one (which is on the list) is that meshes have to share the same material. Almost all vehicle parts in scraps had essentially the same material, but just with different textures for each one, so I combined them all into a couple of 2048x2048 texture atlases (sorry 20th century graphics card users), updated the UVs, and merged a whole bunch of materials into one without any visible change. The only negative that I can think of is that if a lot of parts aren't used at all in a scene, it's a small waste of texture space.

I also met the other criteria for scaling and polygon count, at least on some sub-meshes. So now there should be lots of batched draw calls right? *Well, there weren't. There were zero.


Forward rendering, combined materials: No draw calls batched.

The tips say "Objects that receive real-time shadows will not be batched." *Turning off receiving shadows on all parts had no effect. But I noticed that switching from Forward Rendering to Vertex Rendering did:


Vertex rendering, same settings: Some batched.

Plus vertex rendering has way less draw calls overall - of course it also looks horrible and the terrain has no texture anymore. Anyway, could the now-working batching be because vertex rendering has no shadows at all? Turns out, yes. Turning off casting and receiving shadows in forward rendering created about as many batched draw calls as expected. But then I had no shadows.

Combining Meshes

The best solution would be to combine all the different part meshes into one big vehicle mesh. Then we wouldn't need to worry about dynamic batching at all, because if it's all one big object with one material, it's only one draw call anyway. Unity provides a cool script called CombineChildren in the standard Scripts assets that does exactly that automatically. Using it on a vehicle I made, it merged everything as-advertised into five combined meshes, since I was using five different materials total:


Forward rendering, combined meshes: No batching needed, way less draw calls.

This was a bit of a*naive*approach - it also combined all my gun parts, wheels etc so nothing animated or moved at all anymore. But my solid-block vehicle sliding along the terrain was super-efficient. If only this was a normal vehicle game with normal single-mesh vehicles.

This could be the road I end up taking, but I foresee*potential horrible headaches with implementation. Every time parts are added or removed, the mesh will have to be recreated, and that takes a bit of time. Plus it'll need checks added for stuff like parts that move, or whether the mesh goes over the max vertex limit. Do we have time for all that in the middle of a firefight when a generator gets knocked off?

One Weird Tip (not invented by "a Mom")

Turns out there's a secret to at least getting some dynamic batching, but I don't yet fully understand why it works in some cases and not others. Essentially you want to put each material in a different render queue.

You can theoretically do this by using Material.renderQueue in code, but I got dynamic batching to work by specifying the queue position in the shader itself, e.g.:

Code:
Tags {"Queue" = "Transparent-1" }

That will set the shader's position in the queue to the usual position for transparent objects, minus one. Then use -2, +1 etc to differentiate on other materials. This gave me some working batching at least, with Forward rendering and shadows still on:


Forward rendering, original settings: Some batched!

OK, so that's cool, but for me it only works if I use "Transparent-1" or numbers close to it. And my shaders aren't even transparent shaders, so I want to use the likes of "Geometry+1" instead, but then I get no dynamic batching. And I don't know why. For now it's good enough, but I'll need to look into it sometime. Unfortunately there's no obvious information about it on the Internet that I haven't already repeated here. If anyone really knows why it works like it does, I'd love to know as well.
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #74 on: May 09, 2013, 02:44:06 PM »

I made a proper in-game GUI. Your thoughts?



I've tried to show the necessary info, and only the necessary info. Bottom-left is weapon link state and the type(s) of weapon currently active. Top-right is available power, bottom right current speed (can be changed to mph).

I'm not sure whether I should have it fixed size, or scale it with screen res so it takes up a fixed percentage of the screen. Or partially scale it with screen res. Or let the user set the GUI scale even. Currently it's fixed size so at the tiny res in the screenshot, it takes up a lot of the screen, but at high res it's pretty insignificant.
Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #75 on: May 09, 2013, 04:24:37 PM »

You know, the one piece of code I didn't write myself, the skidmarks code which I stole from the Unity car tutorial; I just noticed that it has massive garbage collection spikes constantly while you're skidding. Like, takes 50% of the processing time that frame massive.

Looking at their code, I think they're re-creating every skid segment every time one segment changes. Unityyyyyyyyy
Logged
Pishtaco
Level 10
*****


View Profile WWW
« Reply #76 on: May 09, 2013, 10:08:35 PM »

I'm afraid that UI makes it look like a game about driving lame 21st century iphone-controlled hybrids rather than awesome 70s testosterone-controlled muscle cars.

Do you have plans for the art style of the landscape?
Logged

Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #77 on: May 14, 2013, 08:19:31 PM »

I wanna try this sooo bad Waaagh!

AND NOW YOU CAN!

That's right, it's a...

Hand Any Key▁ ▂ ▄ ▅ ▆ ▇ █Playable Build!█ ▇ ▆ ▅ ▄ ▂ ▁ Hand Any Key

In this Builder Release, you can try out the vehicle creator and try driving your creation around.

Important Notes

  • This isn't a proper game yet. There's no fighting or damage system implemented. What it is is a functional vehicle builder where you can build a vehicle and test drive it around. This is an early release to give the community something fun to play with.
  • Nothing here should be considered final. Gameplay/physics/graphics/sound etc all need work.
  • The actual game release will not be free. This is a long-running full-time project which already has a lot of time put into it, and will have a lot more. However, updated versions of the vehicle builder demo with new build features are likely in the future.
  • Your weapons need energy to fire. If they're not firing, check your energy. Generators provide energy and some energy storage capacity. Capacitors provide a bunch of cheap storage but no energy.
  • A few notable things that are coming or are known issues:
    - You will be able to assign individual keys to weapons or groups of weapons via the build screen
    - Weapons with rotation range will automatically try to disallow angles where you'll be shooting your own vehicle
    - The vehicle physics are a bit floaty and need some work
    - Many more parts are coming. e.g. cooling systems, energy weapons. More chassis types too (e.g. tank tracks, hovercraft).
    - The vehicle in the build screen can get into weird suspension oscillations. Just click the freeze button to stop it for now if it happens.
    - The handbrake is way too intense right now
    - There's no calculation of aerodynamics - yet
    - There are other minor bugs in this release!
  • If you find a bug or get a crash, there's a bug report button in the game, or send to the bugs email here: http://www.scrapsgame.com/contact

Downloads

Edit:Mac

Linux (hopefully) coming - having some issues with file I/O at the moment.
« Last Edit: May 20, 2013, 02:06:25 AM by Nition » Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #78 on: May 15, 2013, 04:11:08 PM »

A couple of ridiculous designs that I've seen from people already:



Logged
Nition
Level 4
****


Some random guy


View Profile WWW
« Reply #79 on: May 15, 2013, 06:57:11 PM »

I've also received this sweet "aeroplane" car. Too bad I haven't coded in aerodynamics or lift yet.



Hey, does anyone know the "right" way to contact the TIGSource front page people, if there is a way at all? There aren't any contact details on the main site. The Facebook page is an echo chamber. I know Derek Yu has a forum account but he probably doesn't want to be bugged. I'm guessing I'm just meant to hope to get noticed?
Logged
Pages: 1 2 3 [4] 5 6 ... 20
Print
Jump to:  

Theme orange-lt created by panic