Jump to content

tipforeveryone

Members
  • Posts

    382
  • Joined

  • Last visited

Posts posted by tipforeveryone

  1. I want to create a game in which

    1. I can choose Weapons and add them into player's inventory in a sperated map (call "loadout.map")
    2. That loadout can be saved (player can name the saved one as "recon kit", "assault kit" etc..) or select as active loadout.
    3. When a mission map is loaded, player will load saved loadout to play

    Which is the best way to achieve this ? please give me a direction, and yes, C++ way. :)

    The main question is about save and load process, should I use database ?

  2. 3 minutes ago, SpiderPig said:

    I would think that the simple checking of a few variables would have a small effect compared to executing a lot of code in your function.  It depends also on what type of code your executing, but the later would be more efficient.  It's also what I do in C++ to gain better performance.

    Yes that function WithManyCalculation have many thing inside :D thanks

  3. I am optimizing my game's frame per sec and wonder which way of code has better performance

    function Script:WithManyCalculation()
    	--A ton of code
    end
    
    function Script:UpdateWorld()
    	self:WithManyCalculation()
    end

    and

    function Script:Start()
      self.time = Time:GetCurrent()
    end
    
    function Script:WithManyCalculation()
    	--A ton of code
    end
    
    function Script:UpdateWorld()
    	if Time:GetCurrent() - self.time > 60 then
        	self:WithManyCalculation()
        	self.time = TIme:GetCurrent()
        end
    end
  4. 5 hours ago, SpiderPig said:

    You could not model the inside of the scope.  That way you can see through the backfaces of the outside mesh.  Might look okay... ?

    This is a good idea but not perfect, in somecases, the scope model has detail when look from outside but some of its faces still visible inside

     

    8 hours ago, Josh said:

    It is possible they might have modeled it in a way to make it appear that way, like maybe it's actually really really short.

    Thanks for your suggestion. I will try it ;)

    In old COD4, they really make an ACOG scope which player can see inside of it

    Related image

    And then in Modern Warfare 2 or 3

    image.png.1d99a250634057d5fe5af2db1d451a0a.png

    when not in aiming mode, this ACOG look so strange, so what is the real technique :P

    image.png.3400483c75fb843f2067df01ffe718ea.png

  5. sometimes I need to put pivot into some small object models but their icons are too big, is it posible to make these icons (camera, pivot, particles etc) keep their size at the same while zoom in and zoom out in editor ?

    Look at this mess I have

    image.thumb.png.9d8897df6edd59ebc1cb8962bfd21704.png

  6. I wonder how the performance is in 2 ways of using variables in lua.

    Which one is better when there are many of pivots which can be attached script, each script has its own "self." variables

    Method 1: Use table for everything

    Script.table = {} --create masster table of scripts
    
    function Script:Start()
      table.category1 = {}
      table.category1.variable_1 = somevalue
      table.category1.variable_2 = somevalue
      ...
      table.category1.variable_n = somevalue
    
      table.category2 = {}
      table.category2.variable_1 = somevalue
      table.category2.variable_2 = somevalue
      ...
      table.category2.variable_n = somevalue
    end

    Method 2: Use Script.variable only

    Script.valuable_1 = something
    Script.valuable_2 = something
    
    function Script:Start()
    	self.valuable_3 = something
    	self.valuable_4 = something
    	...
    	self.valuable_n = something
    end

     

  7. I remember first few months of using Leadwerks, I can implement a ragdoll in character bone system (using Joints). I love ragdoll physics when shooting some humanoid target, I guess I will use the same technique to my current game.

    ragdoll is possible for current bone system (each bone is an entity) but how about Turbo ? Does that mean "NO HOPE" for ragdoll physic for new system.

     

     

     

    • Like 1
  8. Just now, macklebee said:

    Should be possible as it gives the orientation of the plane. 

    It sound sweet, then please help me with a simple fomula or steps to archive my calculation

  9. Oh I see, Thanks for pointing it out.

    If there is one more vector (a) which have known Orange point position, and it is on the same plane with vector u and w (as figure image),
    and a new beta angle which = 1/2 * alpha angle

    will it be posible to calculate the Black position ?

    image.png.773c2cff4e8fc47bc923fbec4ad8b0cd.png

  10. Thanks for you reply

    All of Red, Blue, Black are in 3D and alpha is not a constant

    Can you help me with a formula, it is bad that I can't remember these basic formulas for triangle calculation

    • red:GetPosition(true)
    • blue:GetPosition(true)
    • u:Length()
    • alpha
    • black:GetPosition(true) = ???
  11. I am not really good at math,

    Can you show me how to solve this

    image.png.16ebe03785c01186a5dffa345b15d4c9.png

    Known:

    • Position of Red and Blue (in Vec3)
    • Length of edge between Blue and Black,
    • Alpha Angle (in Degree)

    I want to get the position of Black (in Vec3)

    Thanks :)

×
×
  • Create New...