playMaker

Author Topic: Help with a scoring system  (Read 6987 times)

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Help with a scoring system
« on: November 02, 2013, 10:27:09 AM »
Hi, I would like to pick your brains on this.

I am looking to develop a scoring system based on how much of your screenspace is filled with a color.

This is what I am thinking:

- bomb goes off, a random number of objects hits walls and other obstacles.
- if you do a "paint by numbers", draw a imaginary line from object to object
- you only draw the line between the "outer objects", so you'll end up a shape that is covering all your exploded objects.
- fill this shape with a solid color and find out how much percentage of your screenspace the shape takes up.
- if the explosion sent object all over the room, you will get a larger shape and higher score and vice versa if the explosion is not so remarkable.

I can draw this out if this looks like a mad mans ramblings, but if you get what I am after, please chime in with some advices.

Edit: I have the explosion working, but does not have a clue how to solve the rest on the list.

Thanks,
Tor M
« Last Edit: November 02, 2013, 02:58:47 PM by Kevron »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with a scoring system
« Reply #1 on: November 04, 2013, 01:44:14 AM »
Hi,

-- Have you investigated Vectrosity for line drawing?
-- Do you have your touch management in place? can you touch object, make relations between the last touched object and the new touched object etc?
-- As for screen fill check. I would maintain a simple surface monitoring based on math.

 your screen is width*height = area. Define a weight ( based on the pixel area covered) for each point drawned by the user, and as the user draw points, add a gran total and compare with the area value. you'll get a sense of how much screen is filled this way.

 Indeed you need to cut down the problem into even smaller chuncks and tackke them one at a time.

Bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #2 on: November 05, 2013, 10:34:19 AM »
Hi Jean, thanks for your answer.
I guess I was not clear enough on what I wanted.

Please look at the attached picture, I think it better explains what I am looking to achieve.

Still not sure if it is possible, but there are some great minds on this forum which may know how to.

Cheers,
Tor M

pdunton

  • Playmaker Newbie
  • *
  • Posts: 35
Re: Help with a scoring system
« Reply #3 on: November 05, 2013, 11:14:48 PM »
Perhaps, and I could totally be wrong, you could set 100 Vector2 or 3 (is it 2d?
)s and then at the end of the level test how many of them are ocupied my that color (again assuming that it is a plane).  That then, would be your percent coverd, as long as you set the 100 Vector2s to be a 10x10 taking up the whole screen.  Just an idea.
Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with a scoring system
« Reply #4 on: November 06, 2013, 01:18:54 AM »
Hi,

 Yes, that's one way, but the algorythm to go trhough the screen and scan for the plane would be quite something to build.

The other way is to find a framework that will compute the actual area of a closed spline. Have you search for something like that?

http://answers.unity3d.com/questions/52664/how-would-one-calculate-a-3d-mesh-volume-in-unity.html

Could you tell us more about how you generate that surface? if it's a mesh, then it's ok to compute the area by summing up all its triangles ( cause it's easy to find the area of a triangle).


Bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #5 on: November 06, 2013, 08:55:37 AM »
Hi,

It is a 3D scene where the generated blodsplats is instantiated "quads" (Unity mesh)

I am not really sure where to start regarding tackling this, but I will look at your link and try to understand the thread.

I love to think up different game concepts, but trying to actually do them is giving me grey hairs :)

I truly appreciate all comments!

Cheers,
Tor M

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #6 on: November 06, 2013, 09:02:20 AM »
Could you tell us more about how you generate that surface? if it's a mesh, then it's ok to compute the area by summing up all its triangles ( cause it's easy to find the area of a triangle).

If you mean the "red surface" that is the filled shape, I have no clue how to create that :)

I guess the steps are:
1) draw a outline around blodsplats
2) make the outline a nice bezier curve
3) make the shape solid with a fill color
4) calculate mesh-volume?
5) give a score based on mesh-volume/screen area

Cheers,
Tor M


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with a scoring system
« Reply #7 on: November 07, 2013, 01:38:27 AM »
Hi,

 I am wondering how you achieve to draw the filled shape? can you detail a bit more on this?

Bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #8 on: November 07, 2013, 05:24:11 AM »
Hi Jean,

It could be that I am misunderstanding your question, but my filled red shape is now just a photoshop mashup. How to actually do it, is why I posted here.

I your question is about gameplay concept, then the filled shape should be an approximation of the blodsplat area. It may be that drawing a line from blodsplat to blodsplat to create a curve is not necessary. Is it a possibility to create a new object based on several prefabs positions?

Thanks,
Tor M

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Help with a scoring system
« Reply #9 on: November 07, 2013, 08:08:44 AM »
Since the bloodsplats are different sizes will drawing a line to the center of the object be sufficient? It seems like you would want to draw it to the farthest vertex from the center of the screen or maybe even consider the tangent relationship to its next nearest vertex in the splatArea shape.

It seems like quite a challenge to make the shape.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #10 on: November 07, 2013, 08:41:14 AM »
I think that drawing a line from the center of each object would be sufficient. I only need the overall shape to be an approximation of the splat pattern.

I does not need to be exact, but it should be a fun and artistic way of visualizing a game score. I have no problem with cheating on how to create it, but it should somehow resemble the bloodsplat pattern.

Thanks,
Tor M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with a scoring system
« Reply #11 on: November 08, 2013, 12:51:10 AM »
Hi,

 Ok, I see now.

 -- simply express your splat points as screenpoints using the action "World To Screen Point", and build your flat shape using Vectrosity for example ( I would definitly use vectrosity... else it will be a nightmare to create concave shapes and all).


Bye,

 Jean

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #12 on: November 08, 2013, 03:04:06 AM »
Great Jean, thanks!

I'll change this thread to solved when I have my scoring system done. I guess I have some more questions along the way.

Regards,
Tor M

Kevron

  • Junior Playmaker
  • **
  • Posts: 51
Re: Help with a scoring system
« Reply #13 on: November 12, 2013, 10:39:41 AM »
I have now bought Vectrosity, and it looks like a powerful addition to Unity.
But, is the playmaker actions a bit limited or does I not see the full extent I can use Playmaker to control Vectrocity?

Can I make curved lines? There are some demos in the vectrocity package that would be great to "port" over to playmaker. The ones called "spline" and "DrawlinesTouch" would be fantastic to have playmaker support for.

Or is this the part when I get in touch with somebody who can script, and pay them for a tailor-made script for Vectrosity. I am just so happy with playmaker, that I want to create EVERYTHING with it :)

Thanks Jean, I know it is basically you who addresses the different help requests on this forum, and I don't think playmaker would have been the great package it is if you haven't given such fantastic support.

Cheers,
Tor M

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help with a scoring system
« Reply #14 on: November 14, 2013, 12:29:02 AM »
Hi,

Thanks :)

 Do you want me to invite you to the trello board to up vote what you would like to see supported next? It's important for me to get organize given the load of pending tasks and requests :) Simply pm me with your email ok?

  Unity 4.3 is out and it's become a priority to provide support for u2d mecanim and pathfinding, I guess the next phase after that will be vectrosity, I am the frist one to would like to spend the time on supporting vectrosity fully...


 Bye,

 Jean