Jump to content

AnniXa

Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by AnniXa

  1. 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?
  2. tyvm that worked =) the one i now use is TEXFILTER_PIXEL, that one seems to be the GL_NEAREST one =)
  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. 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. AnniXa

    new gui stuff =)

    Actually i will write this only in bmx, but i think about changing to c# when my actual project is done.
  7. 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.
  8. AnniXa

    GvB

    yes, the voice is sexy. was "battle chess" this old dos game with animated figures? that was so cool! 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?
  9. AnniXa

    new gui stuff =)

    Hi Rick The whole gui uses just 1 image in my case, of course you can use more than one if its neccesary, every guicore can have its own "skin" and you can have as much gui cores as you want (in my project i have differend cores for the main menu, the edit mode, the simulation mode, so that i dont need to turn on/off a bunch of windows when i switch between those modes) The buttons, window borders,and all the stuff that the gui needs (expect text) are on this image file (to reduce the needed bindtexture()) calls, also the most stuff is a builded Array for the openGL draw arrays thingy / VBO (so they need to be all on the same texture also for this reason). so on the image there are areas of the image, that i call "frames" even when they are not frames in the classic sence like they was in original max2d timage type, since they can all have a individual size, and position, also overlapping is possible. The language is bmx, its just a .bmx file to include, not really a library for now, maybe when i get more further into it and i think that its worth to share this with other ppl then i would make it as blitz-module or something. The "events" are not really existing i think, you can do 2 things for now with buttons: give them an int ptr that they are modifing, depending on the settings of the button, the variable behind the int ptr will be modified, there are differede modes: 1 - Increase/Decrease the int by given values, for example +5,-1 or something, also with max and min values that the int can have. 2 - "swapmode" , the int is switchting between 0 and 1 on each click (and also the button shows itselfs "pressed" when the int is 1" 3 - "setmode", the int is setted to a specified value when the button is clicked, (also the button shows itself "pressed" when this value is settted. Also you can give the button function pointers, the functions will be called when the button was clicked, in combination with the int ptr stuff you can do alot things (i think i can do everything i need with this system): Just increase/decrease a value, without need for any function Modify a value und call a function that do something with it. Modify objects fields by just give the fields as int ptr Also its pretty nice to make more buttons that modify the same int variable, every button with "setmode", and then you can make easy category switch thingies with this (on button click -> set int to a value, and run a function that do stuff depending on the int)
  10. yea maybe someone knows what the .value field is really for 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 )
  11. AnniXa

    new gui stuff =)

    Today and yesterday i wrote alot of new gui stuff: GuiFrameView, wich is adding just a rect that shows a frame from an timage object to the vertexbuffer of the containing window, This can be a classic max2d like frame or my new IMP frame system. same as a new TextButton, wich is adding 3 rechts, to the buffer, 2 for the both "end piceces" and a stretched one, also it adds a ttexthandle to the buffer. Width can be auto assigned from the text, or manually setted (in this case the text will centrated in the button) Also i added a (not so) simple text lists, that got a buildin support for the mouse stuff, detecting wich entry was hovered/klicked, the possiblity to set a function pointer that is called when a list entry is clicked, and some methods for getting the last clicked ID or Text. Also included is autscroll down when new text entry appears, and a "max entrys" setting. When a flag is set you cann scroll the menu when you with the mouse over with the mousewheel Also the first visibile entry can be used to point them into pointer buttons, or then in future comming pointer scroller, wich can modify the var behind the pointer depending on how you scroll it. And another nice extra are "Entity buttons", a button that can be atached to an entity, and fixes up its position to the entity, also there is a special extend of that that uses 2 extra pivots to "stretch" the button over the entity, wich can be handy maybe sometimes B) This the first implement of the entity buttons is just using tann2d´s drawimagerect instead of adding the button to the buffer arrays of the windows, because the buttons will "delete" them self from the carrier window when the entity to wich them attached is Freed, and so i would neet to rebuild the whole window array anytime when a new entity button apears or is getting deleted. Maybe i create a differend kind later that means to be more a "static entity button" wich is more for entitys that stay over the whole time, but im not sure if this is a good idea, sinc when i have like 100 entitys thate are not in view, there would still be room in the windowarray for them, and the quads/tris would be still drawn (because i dont use an arrayindex) so At least here some screenshots =) Some textbuttons, textfields, iconbuttons with differend modes in action. The new textlist in action Some "EntityButtons" in action Enjoy life!
  12. 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.
  13. 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.
  14. 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.
  15. 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
  16. this is not working to me Since MyEntity still refers to the Entity (even when its not in the world list and stuff anymore), (i also still can acces the .position field and stuff).
  17. 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
  18. Thank you very well for this clearifing example code! I tried that, but since the body is not rotating well into the fly direction this not looked so good. i think thats what i do now =)
  19. 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?
  20. ty, just checked it more out and found the bug somewhere else =) sometimes its so strange loosing so much time when concentrating onto the wrong problem
  21. Actually i ported my Gui system from MiniB3d / native OpenGl to LE preamble: since im legastenic and english not my main language, this text could be very ugly to read for you, sorry for this. I will try to improve this in Future posts, but it cost me like 8x concentration to to care about correct spelling, so then i would take 4 hours for this text intead of 10 minuts, please be sorry with me in this case! it was easyier than i thought first, also i just rewrited some stuff that i was not so superhappy in LE with, for expample i wrote my own font and display text managment system, and made it more compatible with the blitzmax 2d original stuff. Same i did with drawimage() and simple graphic primitive functions. the following max2d functions are "converted" now, at first i made it compatible with Minib3d - Max2d to use all my old gui stuff just in Leadwerks Engine 2.4 BeginMax2d() 'this sets the GLortho and all the stuff EndMax2d()'this sets all back =) Also then the native Max2d Draw primitves functions that rewrited: SetColor(r:Byte, g:Byte, b:Byte) SetAlpha(alpha:Float) Plot(x:Int, y:Int) DrawRect(x:Float, y:Float, width:Float, Height:Float, fill:Int = 1) DrawLine(x:Float, y:Float, x2:Float, y2:Float, draw_last_pixel:Int = True) DrawOval(x:Int, y:Int, width:Int, Height:Int) DrawPoly(xy:Int[]) then i missed the Max2 frame image stuff, so i wrote a loader that extract the UV coordinates like the max2d frames LoadImage:TImage(file:String, flags:Int = -1) LoadAnimImage:TImage(file:String, cell_width:Int, cell_height:Int, first_cell:Int, cell_count:Int, flags:Int = -1) then a new func, that i really like it extracts the UV and such coords from a special "IMP" file, with this the frames can have a differend size, very handy for making gui stuff with just 1 texture (saves up alot of rendertime when just 1 bindtexture() is happen for the whole gui) LoadAnimImageIMP:TImage(file:String,impfile:string, cell_width:Int, cell_height:Int, first_cell:Int, cell_count:Int, flags:Int = -1) drawing is like max2d style: DrawImage(image:TImage, x:Float, y:Float, Frame:Int = 0) DrawImageRect(image:TImage, x:Float, y:Float, sizex:Int, sizey:Int, Frame:Int = 0) Also i was a little bit unhappy with the LE font system (its nice, but something was strange to me) so i wrote my own font system based on fonts that where made and exported with the FontMaker tool from southern lake. the special differend is that there is just the normal max2d like stuffs: LoadFont:TFont(file:String, ignored1:Int = 0, ignored2:Int = 0) GetImageFont:TFont() SetImageFont(font:TFont) TextHeight:Int(Text:String) TextWidth:Int(Text:String) DrawText(Text:String, x:Int, y:Int) (its all related to my own tfont type) when loading the UV for every char is extracted from the FNT file that was exported with the fontmaker tool, and when writing a text then the string is iterated through all chars and for every char the letter will be drawn (all via glDrawArray) this is nothing special, but the new stuff is the ttexthandle type, that is some kind of "prebuilded" array for a text,it can be created with local text = ttexthandle.createfromstring("hallo world") this will create the UV and vertpos arrays for displaying this text. and after this, teh text can be drawn with text.drawme(10,10) or changed with text.settextfromstring() Also there are lot other functions within the tann2d object type that are rly a handy bunch like drawing images colored, faded rectangels and such stuff, but that are to much to list them all here now i think. And the second bigpart i did in the last week was portig anngui from max2d to leadwerks, at first i just wanted to wrap all max2d functiosn and then just use anngu, and this worked fine. but then i saw alot of new ways how to improve it at all, and fix some issues with the old system. The windows for example are now prebuilded arrays with all window borders and buttons in it, when making a hover effect i just change the UV of the hovered button, to the frame that is given for the "OnHover" thingy, and such a bunch of other stuff. Also there is a very handy tmouse type, that can update the mouse stats, buttons, positions 1 time per frame, and then i can test if the mouse is in x,y with a simple function, and set a tooltip for this and all such little cosmetic stuff like changing the mousecursor depending what the button have setted. The buttons can modify variables behind INT pointers, raise or decrease them with max and min values, and also they can run funcpointers when clicked. This is enough for the start with my ne anngui2 system =) was a hard weekend to get this finished, And since ppl love screenshots here some shots. well the first and second screenshot are anngui in our old minib3d project (an online harvest moon like game) and the third Screenshot is my rewrited gui system for LE, running in my actual and first LE project. =) not much here now, only window and buttons are in, but soon there will come all the olther stuff to: textfields, and lists bbcode text interpreteter for colors, size, bold,underline, and images in texts. tabs, sliders and all the stuff that is needed for my projects in future =) so if Someone is really interested in ever using this gui or maybe only all the max2d functions than just tell me, it made me hard time to work, but maybe i can help someone getting into it faster. i just need to write a little doc for it then, since the code is all commented and "bbdoc" also in German. But its well splitted into tann2d (wich is just the max2d functions stuff for drawing and the font/text thingie) and tanngui wich handles windows and buttons etc (but it need tann2d to work but not vice versa) The bad thing is, that its written in blitzmax, so if you use c++ or something then it will not help you B) now after i got the basics done for my gui stuff, i can start with my first LE game Project, maybe i write more about this later =)
  22. 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 =)
  23. ah! sorry for my late answer here, it seems that it really happend because of another issue. i had some more joints in the "system" that made that strange behavior, well now i just use the "double joint" trick and it works exacly like i want.
  24. 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...