May 21, 2018, 06:16:56 AM

Author Topic: TestPace X [ Developing]  (Read 3127 times)

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing] | Blitz3D
« Reply #90 on: February 13, 2018, 04:52:14 AM »
Test Full Screen.

All for today. ZzzzZZZzzzZZZ

Offline RemiD

  • Hero Member
  • *****
  • Posts: 582
Re: TestPace X [ Developing] | Blitz3D
« Reply #91 on: February 13, 2018, 09:29:37 AM »
imo>>your particles should have a lighter color than the sand on the gorund since more light is lighting the particles.
And maybe less particles spread, because as it is now, it looks like the vehicle is doing "burnout"

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing] | Blitz3D
« Reply #92 on: February 13, 2018, 11:41:42 AM »
What color do you think might be the best, the same color of the sky would be a good choice?

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #93 on: February 13, 2018, 11:52:14 AM »
  :-X

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #94 on: February 13, 2018, 11:54:29 AM »
:-X

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #95 on: February 13, 2018, 12:01:57 PM »
Well, a little poetry, I've been in the project for a month and a half, lots of graphics and no playability, and it's that knowing me, I'm sure that working at the point of cubes, spheres is not very motivating that you can say.

To date, this seems to be working fine, all under control, and the big secret for this to work for me is to have a project structured in several files and although blitz3d is not object-oriented, I try to make it in my mind, so I have the program split into files like TCamera, TCube, TMesh and by a custom in BlitzMax I have something like this.

Translated with www.DeepL.com/Translator

Code: BlitzBasic
  1. ; ---------------------------------------------
  2. ; Proyecto              : TestPace X.
  3. ; Programador   : Yue Rexie.
  4. ; Sitio Web             : http://www.iris3dgames.ga
  5. ; fichero               : TCamara.bb
  6. ; ---------------------------------------------
  7. ; Nota                  : Tipo TCamara
  8. ;                                 Objeto Camara.
  9. ; ---------------------------------------------
  10.  
  11. Global camara.TCamara = Null
  12.  
  13. Type TCamara
  14.        
  15.         Field id%
  16.         Field padre%
  17.         Field ente%
  18.        
  19. End Type
  20.  
  21. Global id_Camara%
  22. Function Init_Camara.TCamara( padre% = False )
  23.        
  24.         Local Self.TCamara      = New TCamara
  25.        
  26.         id_Camara                       = id_Camara + 1
  27.         Self\id                         = Self\id + id_Camara
  28.         Self\padre                      = padre
  29.         Self\ente                       = CreateCamera( Self\padre )
  30.         CameraClsColor          ( Self\ente, 238, 187, 142 )
  31.         CameraRange                     ( Self\ente, 0.1, 5000 )
  32.        
  33.         CameraFogMode           ( Self\ente, True )
  34.         CameraFogColor      ( Self\ente, 238, 187, 142 )
  35.         CameraFogRange          ( Self\ente, 0, 500 )
  36.         FogMode 2
  37.         FogDensity 0.002
  38.         Return ( Self.TCamara )
  39.        
  40. End Function
  41.  
  42. Global cameraDist% = 10
  43.  
  44. Global camxa#
  45. Global camya#
  46. Function UpdateCamara( entidad%, self.TCamara )
  47.        
  48.         Local mxs#
  49.         Local mys#
  50.        
  51.         Local mousespeed#       = 0.5
  52.         Local camerasmoothness# = 4.5
  53.        
  54.         If MouseDown(2) Then
  55.                 cameraDist = cameraDist + (MouseYSpeed() * mousespeed)
  56.                 If cameraDist < 10 Then cameraDist = 10
  57.                 If cameraDist > 25 Then cameraDist = 25
  58.                 MoveMouse GraphicsWidth() / 2, GraphicsHeight() / 2
  59.         Else
  60.                 mxs# = CurveValue(MouseXSpeed() * mousespeed, mxs, camerasmoothness)
  61.                 mys# = CurveValue(MouseYSpeed() * mousespeed, mys, camerasmoothness)
  62.                 camxa# = camxa - mxs Mod 360
  63.                 camya# = camya + mys
  64.                 If camya < 0  Then camya = 0
  65.                 If camya > 45 Then camya = 45
  66.                 cameraDist = cameraDist + (MouseZSpeed() * 3)
  67.                 MoveMouse GraphicsWidth() / 2, GraphicsHeight() / 2
  68.                 RotateEntity self\ente, camya, camxa, 0.0
  69.                 If cameraDist < 10 Then cameraDist = 10
  70.                 If cameraDist > 25 Then cameraDist = 25
  71.         EndIf
  72.        
  73.         x# = EntityX(entidad%)
  74.         y# = EntityY(entidad%)
  75.         z# = EntityZ(entidad%)
  76.        
  77.         PositionEntity ( self\ente, x, y +1, z )
  78.         MoveEntity ( self\ente, 0, 0, -cameraDist )
  79.        
  80. End Function
  81.  
  82.  
  83. Function CurveValue#(newvalue#, oldvalue#, increments)
  84.         If increments >  1 Then oldvalue# = oldvalue# - (oldvalue# - newvalue#) / increments
  85.         If increments <= 1 Then oldvalue# = newvalue#
  86.         Return oldvalue#
  87. End Function
  88.  
  89.  
  90. Function Deinit_Camaras()
  91.        
  92.         Local selfs.TCamara
  93.        
  94.        
  95.        
  96.         For selfs.TCamara = Each TCamara
  97.                
  98.                
  99.                
  100.                 If selfs\ente Then
  101.                        
  102.                        
  103.                         EntityParent( selfs\ente, 0 )
  104.                         FreeEntity selfs\ente%
  105.                         selfs\ente = 0
  106.                        
  107.                 End If
  108.                        
  109.                
  110.                 Delete selfs.TCamara
  111.                
  112.         Next
  113.        
  114.        
  115. End Function
  116.  
  117.  

For me it's the only viable way that I have learned to keep this from getting out of hand, as I have learned on my own, the most reasonable thing is that it's wrong, but this way I feel comfortable.

Now, and the gameplay?, well fifteen days to think about it, and get a simple game where from the landing zone on Mars has to reach the nearest room, Simple no? well sometimes everything is much easier in our minds.

It is necessary to understand the limitations of Blitz3D, when this happens it is much easier to deal with it, so that's it, I have to go to work, today I have to clean a garbage room, sometimes I find interesting things.

Greetings. 

Translated with www.DeepL.com/Translator

Offline Derron

  • Hero Member
  • *****
  • Posts: 943
Re: TestPace X [ Developing]
« Reply #96 on: February 13, 2018, 12:07:52 PM »
RemiD was not talking about changing the hue (the balance of "red green blue") but the light level. In other (but not "correct") words: brightness should be increased.

Dust particles are small stones. If you can: have a look for a very thin stone (must be <1mm I guess). Now hold this stone to the sky and have a look: it brightens up. This is called (I think so at least) transluscency. While laying on the ground line from "top" shines through but you wont see much difference because the ground below is "darkening" the stone (you see the "stones behind the stone"). Now a heavy storm lifts up all these very very tiny stones ("dust particles"). Light can travel through that stones unhindered (you look to the "sky" - which shines through).

Another physical effect is that the light source is bigger than the particle (from your point of view). Just think of why sun behind earth creates that "corona effect".


bye
Ron

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #97 on: February 13, 2018, 12:26:55 PM »


The only thing I can think of at the moment is to modify the particle mixture.   :-X



Offline RemiD

  • Hero Member
  • *****
  • Posts: 582
Re: TestPace X [ Developing]
« Reply #98 on: February 14, 2018, 08:55:07 AM »
For the particles, i suggest to use the same color than the color of the sand (ground), but a lighter version of this color...

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #99 on: February 14, 2018, 03:28:55 PM »
Particles new color.

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #100 on: February 14, 2018, 03:41:30 PM »
Collision of rocks

The task for today is simple, I need the car to collide with the rocks, but obviously it doesn't have to do it with the 1500 rocks, if not with the one that are closest to each of their tires.

The plan is to activate a body of physics for each tire but that all these bodies are asleep unless the distance is too close to the car. Let's see if it works.  :'(

Offline Derron

  • Hero Member
  • *****
  • Posts: 943
Re: TestPace X [ Developing]
« Reply #101 on: February 14, 2018, 03:43:40 PM »
Did you knock over some Marsian animals? Ok, it is called "red planet" but it should look like your ground texture - just brighter. Even the color tone of the background dust/fog is suiting better.


If you do not know your ground color: take the texture. Open it up in your painting program, use a "blur" (eg. gaussian blur) so it gets really really blurred. Then use the eye dropper on the very "monotone colored" image and you got the average color of your ground texture.


You could even do that programmatically: for every pixel in the texture you add to a total rSum, gSum, bSum and divide by amount of pixels at the end. This way you could assign a color right on game start. If you change the ground texture - you will get a suiting color automatically.


You could even check where your wheels are on the "ground" - and if you knew the position, you knew the "texture coordinate" too. Now imagine you have split your texture into a grid of 20x20. For each of these 400 cells you calculated the average color. You have had an array of 400 colors.


Calculating where your wheel is on the texture allows to know which "cell" it is on. Use this cell's color to emit particles of that color.




BUT ... this is graphics, not gameplay.




bye
Ron

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #102 on: February 14, 2018, 07:19:50 PM »
With what you've told me about the load of information, I'm amused about the animals on Mars. :D

The rock collision works that depending on the distance of the car, a rigid body is positioned in the position of the visible rock, it is not perfect, because if we have two rocks very close together only one will have collision, but I think you can leave it that way.


On the particles, I have a simple function that gives the color to those particles, a starting and transition color.

Code: BlitzBasic
  1. ParticleType_SetColor    Smoke,128,0,0,40,255,0,0
  2. ParticleType_SetColor   Rocks,128,64,0,40,128,64,0
  3.  

Code: BlitzBasic
  1. Function CreateEmitter_Rocks% ( padre% = False)
  2.         Local EM%,Rocks%,Smoke%
  3.  
  4.         EM = CreateEmitter( padre% )
  5.         ; ROCKS
  6.         Rocks = CreateParticleType()
  7.         ParticleType_SetImage                   Rocks,8
  8.         ParticleType_SetSpeed                   Rocks,4,5
  9.         ParticleType_SetSize                    Rocks,.005,.05,0.05, 0.03
  10.         ParticleType_SetAlpha                   Rocks,1,0,0
  11.         ParticleType_SetWeight                  Rocks,4,5
  12.         ParticleType_SetRotation                Rocks,1,400
  13.         ParticleType_SetColor                   Rocks,128,64,0,40,128,64,0
  14.         ParticleType_SetEmissionAngle           Rocks,3,0
  15.         ParticleType_SetStartOffsets            Rocks,-0.1,0.1,-0.1,0.1,-0.1,0.1
  16.         ParticleType_SetLifeTime                Rocks,400
  17.         ParticleType_SetBounce                  Rocks,-7,.5,16
  18.         ParticleType_SetPulsation               Rocks,0.05
  19.         ParticleType_SetAddedBlend              Rocks,0
  20.         ; SMOKE
  21.         Smoke = CreateParticleType()
  22.         ParticleType_SetImage                   Smoke,5
  23.         ParticleType_SetSpeed                   Smoke,2,2
  24.         ParticleType_SetSize                    Smoke,0.01,1,0.7, 0.5
  25.         ParticleType_SetAlpha                   Smoke,.1,.3,-1
  26. ;       ParticleType_SetWeight                  Smoke,8,5
  27.         ParticleType_SetRotation                Smoke,1,45
  28.         ;ParticleType_SetColor                  Smoke,238, 187, 142,40,128,64,0
  29.         ParticleType_SetColor                   Smoke,128,0,0,40,255,0,0
  30.         ParticleType_SetEmissionAngle           Smoke,3,0
  31.         ParticleType_SetStartOffsets            Smoke,-0.4,0.4,0,0.5,-0.01,0.2
  32.         ParticleType_SetLifeTime                Smoke,6000
  33.         ParticleType_SetBounce                  Smoke,-5,1,10
  34.         ParticleType_SetAddedBlend              Smoke,0
  35.  
  36. ;       Emitter_SetSound EM, "bang.mp3",0
  37.         Emitter_AddParticleType EM, Rocks, 0,360000,400
  38.         Emitter_AddParticleType EM, Smoke, 0,360000,1800*2
  39.  
  40.         Return EM
  41. End Function
  42.  
  43.  

I suppose you can do something to improve the color and the only way is trial and error.   :'(



Offline Derron

  • Hero Member
  • *****
  • Posts: 943
Re: TestPace X [ Developing]
« Reply #103 on: February 14, 2018, 07:31:30 PM »
As I described: set the color to the "average color" of the ground texture. vary it a tiny bit here and there (each created particle has a slightly different color then - very subtle!). Brighten up the color a bit to take into consideration the tinyness of the particles (transluscency, light coronas....).


Later on you could improve that visual by having a "GetGroundColor(x,y)" function returning a color for the ground under a given x,y coordinate. HOW this is then implemented, can be discussed later. My approach would be some kind of "grid" as you know the underlaying textures (if you have meadows, sands, water... this would vary then). This allows for some precalculated colors to avoid dynamical "color averaging" processes.


bye
Ron

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: TestPace X [ Developing]
« Reply #104 on: February 14, 2018, 07:37:46 PM »
  :'(

Something strange is going on here, but I can't get close to a color similar to the floor. I guess it's a limitation of Blitz3D or I don't know what it might be.