Jump to content

AnniXa

Members
  • Posts

    73
  • Joined

  • Last visited

Posts posted by AnniXa

  1. is it possible to have collisions and stuff without need to use of phyisics?

    I want to move the entitys just with moveEntity() and stuff and check if they touched something.

     

    i know i can start now writing the raycasting stuff, but there is still all that stuff and i dont want to waste alot of time for making raycast tests, is it not possible to use it without body force stuff?

     

    i dont want them to fly around or falling down after a collision when i use apply force stuff,

    i just want them to have collisions, maybe slide but at all i just want the callback.

  2. Hey, for my actual game i made a lobby that is syncing the folder with the stuff for the game session,

    it syncing some .ini files, some .lua files and some very simple mesh files some shader.verts and a .mat file. it checks for MD5 sums and only syncs the neccesary files and stuff.

     

    This works very well and fast at all, but now i wanted to make modders able to also change textures for a game mod, and i wanted to let it sync the textures also, but that .dds files are very big, and a 4mb file takes alot of time to transfer for any reason.

     

    I use raknet for my network stuff and i write my own file transfer stuff since the raknet internal thingie was not working for me.

     

    Actually i send a Reliable pack with file data to the client and it sends a reliable answer, every pack have a maximal packet size of ~1000, so this will be ~4000 packets that need to be sendet for a 4mb DDS file.

     

    does anyone got experiences with such stuff?

    Should i just spam all the packets without waiting for a reply from the client? but then there could be like 4000 packets in the buffer or something

     

    ~edit ahw when i start writing forum posts i mostly get the answers...

     

    i had the update of the server sided synchronisation stuff setted to have a delay of 1000ms, so only 1 packet per second was send...

     

    now it takes just seconds to transfer such files

     

    but maybe someone knows some bether solutions to this?

  3. hi =)

    I would like to use the nearest texture filter,

    how can i get this texture parameters for a materials texture?

     

    glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST
    glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST

     

    or if this is not possible via the material file/functions, how can i acces a specific texture to bind it and make those settings?

     

    ty for your time =)

     

    all i found was this:

    material.GetTexture(0).reference.filter

     

    but changing that value has no result

  4. Hey, when i use GetVertexPosition() than i can get the vertex position of a vert in relation to the mesh,

    is there any function to get the position of a vertex in global? (where it is exacly in the world, not relative to the mesh)

    or do i need to calculate it? if i need to calculate, anyone got a code snipped or something left? =)

     

     

    do i just need to add the position of the mesh? but whats with rotation :(

  5. How can I select and draw a portion of an Image. I have a 1024 x 1024 Image that consists of various buttons and display parts,

     

    Currently I use this code to Draw and Rotate an Image, but I am unsure how to select a section of my image to draw.

     

    Function DrawAndRotateImage(itr:TTexture, Ax:Int, Ay:Int, Sx:Int, Sy:Int, Ir:Float)
           glMatrixMode(GL_TEXTURE)
           glLoadIdentity()
           glTranslatef(0.5,0.5,0)
           glRotatef(Ir,0,0,1)
           glTranslatef(-0.5,-0.5,0)
           glMatrixMode(GL_MODELVIEW)
           glEnable itr.Target()
           itr.Bind()
           itr.Clamp(1,1,1)
           DrawRect(Ax,Ay,Sx,Sy)
           glDisable(GL_TEXTURE_2D)
           glMatrixMode(GL_TEXTURE)
           glLoadIdentity()
           glMatrixMode(GL_MODELVIEW)
           glScalef(1,1,1) 
    End Function

     

    How can I add to this code to allow me to select a portion of the image.

     

    Thanks for any help.

    Eric

     

    You need the UV coordinates of the area that you want to draw, then you need the GL_TEXTURE_CORD_ARRAY state and you need to use glTexCoordPointer, and glVertexPointer and glDrawArrays to draw your image.

    You can use my little 2d library if you want, it gives alot of nice drawing functions, like frames of images like in blitzmax native 2d stuff, a fast image text system, and some other stuff that makes life easyer with 2d,bmx and leadwerks.

    PM me if you want it

     

     

    edit:ooops that thread is very old...

  6. Well i plan to have minimal GUI icons.

    I know GUI systems can eat lot of Frame rate , what i really want to avoid.

     

    So my basic questions ,is what is the fastest way to have Gui Icons ? use our onw system like things drawn on some 3D plane displayed on to pof the scene ?

     

    since you can use any openGL draw functions, even VBO and Vertex/textcoord array drawings, you can really write or port allmost any 2d openGL gui over to LE without any big trouble.

    Drawing arrays with like 100 quads/tris will not rly steal you FPS.(wich should be more than enough for a good concepted gui system including windows, buttons,texts and stuff)

     

    I just tested it with more then 10.000 quads drawn from some arrays with GLdrawarrays() and lost like 1 fps.

  7. Wow Rick. That's really cool. And you have a really nice "video-voice" to :)

     

    yes, the voice is sexy.

     

     

    reminds me of Battle Chess... with a few missing pieces...

     

    looking good so far...

     

    if this is in lua this may be exactly what Josh is looking for...

     

    --Mike

     

    was "battle chess" this old dos game with animated figures? that was so cool!

     

     

    Nope, it's not turned based. Every action you can do has a cooldown to it though. The cooldown is in seconds and you can't use that action until the cooldown is up. You can move as far as you want but the cooldown for movement is 1 second per tile you move so even if you move all the way to the other side of the board on the first move you do you'll be sitting there for some time getting a beating most likely for a good 8 some seconds before you can move around again.

     

    The strategy is very much moving around and doing the right abilities at the right time to avoid being stuck with a cooldown on an action.

     

    Tips for what you are asking would be:

     

    1) Get pathfinding working in Lua. I'm using http://luastar.codeplex.com/

     

    This sounds really like a nice "micro managment" battle game to me, since i love Micro managment battles i think i will like this game alot when its done.

     

     

    a Question, since this is whole written in lua, will players be able to "script" it own abilitys or creatures or something this far?

  8. ..ocky-docky :) important is..it works... by the way, what GUI you use ?

     

    yea maybe someone knows what the .value field is really for :o

     

    I use my own gui, that i wrote by myself in openGL and ported now over to LeadWerks engine (tbh i rewrite it compleply), (check my block if you want to know more :D)

  9. ..of course button.entity is not null..in fact button.entity is just an instance, pointer on to original entity handler MyEntity, so its NOT nulled by simply freeing MyEntity...entity.valid is true or false based on state of original handler (false if nulled, true if not), while pointer (button.entity) still has value different than Null (pointer address)....this indicates that you haven't structured properly your classes, where none of instances (button.entity) should exist if original handler (MyEntity) is freed..

     

    Maybe this is a thing of taste, i want a tentity button that just dont need any extra stuff/clases then just an entity where it is attached to.

    Because of the gui should be absolutely independent of the rest game process, and just run with leadwerks itself.

     

    But however, thank you for the help and your time alot.

  10. all you need to do in Bmax really is

     

    FreeEntity (MyEntity)

    MyEntity = Null

    GcCollect()

     

    ..after handler is nulled, thats it..some objects may require FreeEntity, such as meshes, but some DONT, such as sound sources, or sound files...either way, they have to be nulled after FreeEntity is performed (if FreeEntity, apply on to such entities), and thats all..im just not sure, how is possible to have entity handler available with its properities, after is nulled..

     

     

    the problem in my case is, that i just cant do this:

     

    FreeEntity (MyEntity)
    MyEntity = Null
    

     

    because there are more than one refers to this entity in my example :

    1 is in the type of an "EntityButton" type, a clickable button that is allways located to the entity, and is handled via my gui.

    2 is somewhere in the game logic

    and since i make a strict seperation between my gui stuff and my game logic stuff (because i want to have the gui for itselfs for later projects), do they have a own refer to the same entity.

    when now somewhere in the game logic the entity is freed, then the button type does not take any notice from this, because the field entity of the button was not made to null.

     

    so i wanted to make the buttons a pre-test, if the entity that they are dedicated to was free from somewhere (and this works fine for now with the .valid field)

     

    ... somewhere before:
    type tEntityButton
    field entity
    end type
    
    local myentity:tentity = loadmesh(...)
    
    button:tentitybutton = new tentitybutton
    button.entity = myentity
    
    ... somewhere in the game loop
    
    FreeEntity(MyEntity)
    MyEntity = Null
    
    

     

    after this

    button.entity ist still not null, because it still refers to it.

     

    now when the next button position update comes i just do something like

    method UpdatePosition()
    if self.entity.valid = 0 then
     .... remove the button (because the entity of this button was freed
    else
      .... updatding the button pos to the entity on screen
    endif
    end method
    

     

    this works fine, but i dont know what the .valid field really is for, maybe someone knows?

    all i know that freeentity() seems to set it on 0 for any reason.

  11. ..well..equalizing with null should certanly do a job..after that you should call GCCollect(), not before..

     

    MyEntity:TMesh=LoadMesh("abstract::MyMesh.gmf)
    
    FreeEntity(MyEntity)
    MyEntity=Null
    GCCollect()
    
    If MyEntity=Null
     DrawText("YAY, its freeeeeeeed !",0,0)
    End if
    

     

    ..what is the reason behind use of GCSetMode(2) ??

     

    EDIT:

    Also, keep in mind that garbage collector DOESNT flush out things imidiatelly, once command is called...

     

     

    i just tried it like in some example, normaly i use mode 1 =)

     

    well i just found out that the ..valid field seems to be set on 0 when freeEntity() is runned, so i use this now to check if the entity was freed

     

    I write an "EntityButton" for my gui, some button that can be attached to an entity and wich is updating its position regulary to the entityPos on screen, and since i want a strict split between my gui stuff and my game stuff, i cannot just do myentity= null, because the EntityButton got a field Entity, wich wil not know if i use FreeEntity(), but now i just check on every button position update if entity.valid >0 and remove the button if not. it looks like this works.

  12. ..you should call garbage collector after FreeEntity, and given example is from Bmax, and it works fine..so im not sure what you using..other way is to have a flag what will determine is your mesh unloaded or not...that will require writing of some Loader/Unloader class, what is a must anyway..so withing that class should be member determining state of given entity, something like 'Loaded:Int'

    So, when you load your entity then Loaded flag will be set to true..soon as you use FreeEntity, it will be set to false...on that way you can always know whats going on with entity by accessing its state member from loader class..

     

    okay this might help,ty very much.

     

    i got it the following now:

     

    GCSetMode(2) somewhere at the top, and somewhere in the mainloop GCCollect().

     

    but i still can access it, i think the GC will not clear it until i made it =null

     

    (same as with mode 1)

     

    i think i just try that loaded field :)

  13. Hey guy´s,

    Another question:

    When we have some entitys, and we refer to them from my own list or something, can we anyhow test if FreeEntity() was used on that entity, to nullyfy my refer then afterwards?

     

    Maybe some field in the entity that is indicating if the entity was freed or something? =)

     

    Greetings

  14. You most likely dont need to calculate that since Le is all "entity-based" ...

    you simply want to set the position / rotation of your bolt / bullet to the position / rotation of the body or set its complete EntityMatrix.

     

    I took "all" the commands i would need to build game-subsystems from the command list and wrote samples for it.

    It doesnt help much with integration the game-engine itself but game-mechanics can be extracted from it.

     

    here is some, slightly changed, script metraton posted (dont know how to write that name though)

     

    --stuff which should be part of LE
    ....
    
    

     

     

    hth

     

    Thank you very well for this clearifing example code!

     

    I'm not quite sure what you mean.

     

    to attach a TMesh to a TBody is done by setting the mesh's parent to the body.

     

    EntityParent(Your Missile,your invisible body,1)

     

     

    to then make the mesh "look in the same direction"

     

    RotateEntity(Your missile,EntityRotation(invisible body,1),1)

     

     

     

    And now the mesh will move with the bullet automatically...

     

    I tried that, but since the body is not rotating well into the fly direction this not looked so good.

     

     

    For bullets I would perform a raycast each frame, and use AlignToVector to orient the visual mesh.

     

     

    If you load the mesh and the body at 0,0,0 and then parent it and then position the body and fire it you shouldn't have to rotate the mesh to be in line. Provided that the body and the mesh match....

     

    But I would recommend what Josh said anyway, align to vector would be the best way to go

     

     

    i think thats what i do now =)

  15. Hi =)

    I have the following scenario:

    A simple invisible tbody that is flying like bullet throught the world, and now i wanted to attach a bullet or missile mesh to this body, and i wanted to calculate the rotation for the missile depending on the velocity vector of the body thingy, and then apply this rotation to the missile mesh and set it on the position of the body, so that it looks like the missile is flying like the body.

     

    But for any reason i cant find out how to calculate the rotation that i need for the missile, since the school is long time ago :(

    maybe someone knows a simple way to do oit? maybe there is some prebuild function with the vec3 ojects or something else like this that i missed, or maybe someone knows a simple formula or something for this?

  16. Hey, if i create an emitter, how can i remove it later (not just pause it?)

    I would like to make some effects with temporary emmiters.

     

    i tried FreeEntity(emitter:temitter) on that, but this made me a UHE.

     

    also the method emmiter.free() did not worked (same problem as freeentity())

     

    Or is it as alternative workaround possible to just spawn a bunch of particles without an emiter? for explosions for example.

     

     

    the last way i see is to have some emmiters and move them to positions of explosions,paint them with material and make settings for the next effect, unpause them for a while and pause them then again.

     

    But under the line this would be uncool, since i hope that LE got a simple stuff for that =)

  17. just tried this myself and I am not noticing any difference in response depending on which body I apply the force to... do you by chance not have the joint located at a spot spaced evenly between the two bodies? maybe post some example code of your problem so others can try...

     

     

    i think the problem is, that the position of the joint is relative to the parent, so it is just not possible that it can handle them exacly same (to reach this must the joint allways be exact between the 2 bodys, but i think this is not possible since i cant change the position of the joint afterwards to set it between the 2 bodys) but maybe im wrong here, thats what i think what it could be.

     

    Actually i use the "doppeljointball" solution and its working bether than i expected.

     

    i try to make a code sample =)

×
×
  • Create New...