TOPIC_TITLE
stringlengths
4
128
CATEGORIES
stringlengths
13
48
POST
stringlengths
0
85.6k
ANSWERS
stringlengths
0
146k
Hi I'm new. Unreal best option ?
For Beginners
Hallo everyone. My name is BBCblkn and I'm new on this forum. Nice to virtually meet you 🙂. One of my biggest dreams is to make my own videogame. I love writing design as in text on how my dream game would be. Now I got no skills to create it. But who knows what life will bring. Is Unreal the best program to have fun with an experience ? Obviously I prefer a simple but capable program. Not pre designed auto drop. Why not install Unreal and roam into it and see if anything happens.My favorite games are in the genre of Fantasy, usually stone age with magic. Dota, Homm, Diablo and the odd one out is the genius Starcraft 1. But I played plenty of different games, especially when I way younger. I don't game currently at all but designing gets my creative juices flowing and is so inspiring and fun. Thanks for having me guys
BBCblkn said:My name is BBCblknI am truly sorry for you. Even Elons daughter has a better name than that.BBCblkn said:Is Unreal the best program to have fun with an experience ?Give it a try, but it's not meant for total beginners.Starting small always is a good idea. 2D is easier than 3D. You could try GameMaker, learn some programming language, learn some math, move on to more advanced engines like UE or Unity… ;There's honestly no perfect program for beginners. If I had to compare Unreal though at my skill level, I would probably pick Unity. However, It really comes down to your needs, and how much programming you want to learn. Furthermore, I would also keep in mind other engines.;@BBCblkn I'd recommend Gamemaker studio 2 as a first engine. It's easy to learn and I haven't had a problem making my game ideas in it yet.There are some good tutorials on YouTube to follow to learn it. Do note you'll be limited to 2D games with GMS2.Bit late to the post, but I hope it helps;gamechfo said:Bit late to the postTwo months late. Always consider whether you honestly believe that a question asked long in the past is still awaiting an answer. Thread locked.
How to publish a book?
GDNet Lounge;Community
Hello, So, over the holidays I finished my 1st book. Do any of yall writer types know where I can find:an editorpublisherIt's like 99% done, just need to know what to do next. Also, it's cross genre, so it doesn't necessarily fit the standard model.
You've given nowhere near enough information to get a final answer, but I can suggest next steps for you. (For background, I've worked as an author, co-author, editor, and ghostwriter on 9 books so far.)Publishing is a business deal. You need to figure out what business services you need.Do you even need a publisher? Do you need a distributor? You already mention needing an editor. Do you need marketing? Do you need retail agreements? Digital or physical? If physical, POD or offset, how many each of hard or soft, what size of print run can you afford? What business services do you need? Publishers have an awful lot of potential features of what they can provide and what those services cost.Once you know the list of services you actually need, your favorite bookstore will have books that have listings of all the major publishers and hundreds of minor publishers, along with the services they provide and the specialties they work with. Work through the listings methodically, and talk to them all until you've got a deal. You'll also want to start shopping around for a lawyer at that point, both because they have connections and because they'll be working with the contracts you'll be signing.Once you know what you need and have talked with your lawyer the first few times, you will be ready to start shopping around. It's far better if you have more money and are using the publisher as a paid service. That is, you pay them for the services they provide up front. It will cost you many thousand dollars but you'll require far fewer sales to reach profitability. It can be better to do an online plus POD service starting out if you're self funded. If they need to front any of the money there will be two phases to the deal, one phase before it's profitable and another after a threshold is reached and it's profitable. The exact terms will depend on your needs and the services they'll be providing. Before you sign with anyone, you'll need to work back and forth more than once with your lawyer to help you negotiate what's fair in the agreement. Good lawyers understand the costs of the various services and can help you get fair rates.Just like publishing games, the more you need from them the harder your pitch becomes. If you need a lot of services the more it will cost you. If you're looking for them to invest in you, front you money, and pay for the books, don't expect a lot of money from the deal, and in addition your pitch needs to be amazing and you'll be rejected many times. If you've got the money to self-publish and are only looking for retail agreements that's rather easy. ;hmmmWell Self publish might work too. I'm looking for:an editor publishing distribution for ebookNo hard cover or physical book planned at this timemaking cover art. Future Audio book production. I think that's it. I'd be willing to do physical print if needed, but I don't really want to pay for that at this time. frob said:You've given nowhere near enough information to get a final answer The issue is I don't know what questions or criteria I should be asking or looking for. ;Have you considered publishing with Packt?https://www.packtpub.com/;GeneralJist said:2. publishing distribution for ebook 3. No hard cover or physical book planned at this timeFor distribution of an ebook there are plenty of options. Amazon is the biggest with kindle direct publishing requiring little more than an html file and an image for the title. If you are comfortable with software tools you can use that same document to build/compile every other format out there. You're on the hook for everything else with the business if you go that route, but it can work well if you are marketing through your own channels.There are many ebook publishers out there targeting specific platforms and specific readers or specific genres. I mentioned publisher lists, they also include electronic-only publishers. Understand the tools they use against piracy are also helpful since otherwise anybody with access to the file can make unlimited copies.Be careful of contracts, you almost certainly want something that has a non-exclusive agreement since you've done all the work yourself already. If a publisher wants an exclusive deal they need to be putting quite a lot on the negotiating table.GeneralJist said:4. making cover art.Find an artist with the style you like and contact them. Often it's in the range of a couple hundred bucks, especially for ‘unknown’ artists when they're starting with something that wouldn't have seen the light of day otherwise. Artist friends are best, and asking around at local art schools is inexpensive.GeneralJist said:5. Future Audio book production.If you don't need it now, it's something easily done later.GeneralJist said:1. an editorThis one is the most difficult. Skilled editors are amazing. If you go with a publishing house they'll provide professional editors, at professional rates. ;taby said:Have you considered publishing with Packt?https://www.packtpub.com/hmmm 1st time hearing of them.Looks like they are more of an educational option?My book is a mix of mental health journey auto bio, and Sci Fi elements. It's not really a standard “how to” for game dev. ;so I just heard back from my 1st publisher submission.https://triggerhub.org/​And they essentially say they be willing to look at it deeper, and have extensive edits to focus on the mental health angle. but they would want me to cut a lot. From what they are hinting at, It sounds like they want to cut a lot of the Game dev and gaming journey, as they are a publisher focused on mental health.So, now I need to decide what to do.I sent them back an email saying I'm open to continued dialogue.Without knowing exactly what they want to cut, and edit, I don't know how to proceed.Also, would it be better to hold out, and find a publisher that is willing to accept most of the game dev journey, as I'm looking for a continued publisher to work with, aka accept most of the book as is. Any advice would be helpful.Thanks yall. ;GeneralJist said:Any advice would be helpful.Look into your own mind and heart.;hmmmok,So I've submitted to a few other places.We shall see.I submitted to this place called author House, and they got back to me really quick, but it looks like they want me to pay a couple thousand for a package:https://www.authorhouse.com/en/catalog/black-and-white-packages​I personally find that a bit frustrating.I mean, really, I wrote the book, I thought traditional publishers get paid from a % of sales?@frobWhat do you think?Is the above package a good deal?I was also a little put off, as it seems the person who called me didn't even read anything about my book, and asked me “so what's your book about?"beyond the above, how does this usually work? Edit: so, after a bit of basic research, it seems the above organization is a bit scamy. The hunt continues. ;You're unlikely to get a publisher deal, where the publisher pays you an advance and distributes your book to retail outlets.You'll have to self-publish, meaning you have to bear all the costs for printing, and nobody will distribute it for you. https://en.wikipedia.org/wiki/Vanity_press​
First-person terrain navigation frustum clipping problem
General and Gameplay Programming;Programming
I am trying to develop first-person terrain navigation. I am able to read a terrain and render it as well as to move around the terrain by interpolating the location of the camera every time I move around. The main problem I have is that depending on the terrain, i.e. moving on a sloping terrain, the near plane clips my view (see below). What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.
I believe this can aways be an issue. I mean if you are clipping to a near plane and that plane passes through geometry, it has to do something. That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it. Another other thing to consider is once you have collision working, you can put your camera, including your near clipping plane inside a collidable object, for instance a sphere, such that this problem will never occur. If you are eventually going to make this a real first-person game, that should take care of the problem since your camera will be inside the players head. Even in a 3rd person game you can put them inside a floating sphere. ;Gnollrunner said:That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it.The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.mllobera said:What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.Yes, basically you want to ensure that the camera is in empty space (above the hightmap), not in solid space (below the heightmap).But in general you can not treat the camera as a simple point, because the front clip plane requires a distance larger than zero. So ideally you build a sphere around the camera which bounds the front clip rectangle of the frustum, and then you make sure the sphere is entirely in empty space, for example. In the specific case of your terrain not having too steep slopes however, it should work well enough to sample height below camera, add some ‘character height’, and place the camera there. That's pretty simple and usually good enough for terrain.It's quite a difficult problem mainly for 3rd person games in levels made from architecture. It's difficult to project the camera out of solid space in ways so the motion still feels smooth and predictable.Some games additionally fade out geometry which is too close, attempting to minimize the issue.Imo, the ‘true’ solution to the problem would be to let the clipping happen, but rendering the interior volume of the geometry as sliced by the clipping plane.That's pretty hard with modern rendering, which usually lacks a definition of solid or empty space. But it was easy to do in the days of Doom / Quake software rendering. When i did such engine, it was possible to render clipped solid walls in simple black color. This felt really robust and not glitchy, so while it does not solve all related problems, i wonder why no game ever did this. ;@undefinedJoeJ said:The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.You can clip to a pyramid instead of a frustum. I used to do this many years ago on old hardware. So there is no near clipping plane. In fact you don't need a far clipping plane either.Edit: Just wanted to add as far as I know the near and far clipping planes mostly have to do with optimizing your Z resolution. If you are dealing with that in other ways, I think they aren't strictly necessary. I currently don't even deal with the far plane and let LOD solve Z-fighting issues.;Gnollrunner said:You can clip to a pyramid instead of a frustum.I see. You still have front clip. It is a point, formed indirectly as the intersection of the other other frustum planes.I've misunderstood your claim to be ‘you don't need a front clip’. But you didn't say say that. Sorry. But now i'm curious about the experience with z precision you have had. I guess it just worked? Which then would probably mean: All those painful compromises of ‘make front plane distant so you get acceptable depth precision for large scenes’, are a result of a bad convention being used by APIs?Or did you use no z-Buffer? ;@undefined My whole engine is based on aggressive LOD and culling. I don't do projection in the matrix. It's a post step. My Z coordinates are world distances. My current project does have a near clipping plane mainly because DirectX wants one, but it's not that relevant for my application.;Ah, so you use the pyramid for culling only. But for rasterization, the usual front clip plane at some distance i guess.Still an interesting question if ‘some distance’ is really needed, but i guess yes.I did some experiment about point splatting. It uses spherical projection, which is simple than planar projection:auto WorldToScreen = [&](Vec4 w){Vec4 local = camera.inverseWorld * w;if (local[2] < .1f) return (Vec3(-1)); // <- front clip at some distance of 0.1Vec3 screen = (Vec3&)local;screen[2] = length(screen); // if it was zero, i'd get NaN herescreen[0] = (1 + screen[0] / (screen[2] * camera.fov)) / 2;screen[1] = (1 + screen[1] / (screen[2] * camera.fov)) / 2;return screen;}; Planar projection would cause division by zero too, i guess.;Thanks for all your comments! I will need to investigate how to do what Gnollrunner proposed (about putting the camera inside of a sphere). ;This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, it likely makes some sense to have a smaller near-plane distance for the former than the latter.Now, this only ameliorates the problem, it doesn't remove it entirely: it means that the problem will still appear, but only if the player gets very close indeed to a surface. It's intended to be used in conjunction with one or another means of preventing the camera from approaching quite so near to a surface (such as the sphere-approach mentioned by others above).;Thaumaturge said:This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, I'm not sure that's so true. I mean in both cases you have to take care of the problem somehow. The case of a first-person camera is a bit easier because it should always be in the collision boundary of the player (sphere(s), ellipsoid, capsule etc.). As along as the near plane is also within that boundary, the problem should never occur. So if you have a 10cm radius sphere and put the camera in the back of it, that gives you maybe a 10 to 15 cm camera to near clipping plane distance to play with depending on the field of view you are going for. With a 3rd person camera, you can also get very close to terrain, in fact your camera can end up within terrain or some object if you don't do anything to solve that problem, and this will happen very often without separate camera collision. One typical way to handle this is just implement your following camera, ignoring terrain considerations. Then to figure out your camera's actual position, project a line back from the head of the avatar to the camera's ostensible position, and see if it intersects anything to get the camera's true position. In reality you should project a cylinder and not a line since your camera will need its own bounding sphere to contain the near clipping plane. In any case this means that as you move around your camera can jump forward to clear terrain and objects. I've seen this in a few MMOs. However, when you leave blocking terrain you have the option of implementing smooth movement back to the cameras desired location. If you want to get really fancy, I guess you could try to predict when your camera will need to jump forward ahead of time and try to do smooth moment forward too. Maybe you can have a second camera bounding sphere which is somewhat larger, that would trigger smooth movement, but I think you would still need a fallback camera jump routine to be safe.
Is there a good matrix class?
For Beginners
I am currently trying to implement a version of Whole History Rating (http://remi.coulom.free.fr/WHR/WHR.pdf), although my version will be slightly different because it is designed for a team game.Anyway, I'm not sure what to do for the matrices and vectors. Are there existing classes that are suitable, or should I attempt to write my own? All of the matrices will by tridiagonal, so ideally, the class should be able to take advantage of that and optimize it.One other question I had thought of is, if a class has an object as a member variable, for example, a std::map, can I safely assume that it has been initialized with the default constructor? My code seems to be working so far, but I don't want to accidenttally invoke undefined behavior.
Quote:Original post by StoryyellerOne other question I had thought of is, if a class has an object as a member variable, for example, a std::map, can I safely assume that it has been initialized with the default constructor?No. Inside the body of the constructor, the member initializers for any members declared after that variable or any member functions you can assume that it's been properly constructed, but you can't assume that the constructor used was the default constructor.; bump ; Have you searched Google for such classes? If you found some, why are they unsuitable? ; The only thing I could find was Sparselib++, but I can't find anything that explains how to use it. ; You know, when I punch "C++ matrix class" into Google I get a lot more than just Sparselib++ back. ; A matrix? Uh... try an array, it's literally what I computer matrix is.You can have single or multi-dimensional arrays in which you can place any kind of data type in. Examples:1D Array (1x4)[Integer] [Integer] [Integer] [Integer]2D Array (3x4)[Object] [Object] [Object] [Object][Object] [Object] [Object] [Object][Object] [Object] [Object] [Object]Maybe you get the point. ? I also assume you're using C++, here's a clicky link. And another. And yet another.Hope I was a help, otherwise, sorry for wasting your time! :D ;Quote:Original post by mntlinstituteflrA matrix? Uh... try an array, it's literally what I computer matrix is.You can have single or multi-dimensional arrays in which you can place any kind of data type in. Examples:1D Array (1x4)[Integer] [Integer] [Integer] [Integer]2D Array (3x4)[Object] [Object] [Object] [Object][Object] [Object] [Object] [Object][Object] [Object] [Object] [Object]Maybe you get the point. ? I also assume you're using C++, here's a clicky link. And another. And yet another.Hope I was a help, otherwise, sorry for wasting your time! :DI'm not sure how relevant any of the above is to the stated problem. A proper matrix class is very different than a simple 1-d or 2-d array, and can include a more or less arbitrary amount of functionality (either directly or indirectly) beyond that provided by a simple array. (I'm assuming this is what the OP is looking for - a linear algebra library that includes classes for matrices and vectors, and is specifically suited to a particular application or set of applications.) ; There are a TON of C++ matrix libraries, and which one to use depends on your needs. Some of the following come to mind uBLAS, newmat, blitz++ (full fledged array library), SparseLib++ (as you found), MTL, eigen ... I'm getting tired already. What are your requirements (dense/sparse) what operations do you need? You need to give us more info if you want a thorough answer. ; The problem with an array is you can't perform many operations on it. So that's why you have matrix classes, so you can for example do things as:m1(2,2) = 4; // Assign value to position (2,2)m3 = m1 * m2; // Multiply matricesm2 = -m1; // Invert matrixI'm sure there are tons of classes available, otherwise you can easily make one yourself as the information on how to perform these operations can easily be found.
[XNA] Matrix.CreateLookAt not behaving as expected when changing the Up vector...
Graphics and GPU Programming;Programming
For the past while I have been unsuccessful in implementing camera roll. I've got yaw and pitch working just fine, but roll has proven to be considerably more difficult.Here's more or less what I am doing:Each frame I'm capturing mouse (and keyboard) input to get the yaw, pitch, and roll. Using the yaw, pitch, and roll I create a rotation matrix to rotate three points around the origin (representing the camera's target, 'up', and 'right' vectors). I then translate that into place to the camera's real position and create a view matrix using Matrix.CreateLookAt(), passing in the camera's position, target, and up vectors.Now before you jump on this and say it is a gimbal lock problem, I don't think it is. The only thing that I am keeping between frames is the yaw, pitch and roll. I'm regenerating the rotation matrix from scratch each frame, so I'm pretty sure it isn't a gimbal lock problem.For the curious, here's the bit of code that I am using to do the aforementioned://boring bits of getting the input have been ignored. At this point yaw, pitch, and roll contain the yaw, pitch, and roll of the camera, as they should. //update the rotation matrix according to the yaw/pitch/roll. Rotate the lookat point rotationMatrix = Matrix.CreateFromYawPitchRoll(yaw, pitch, roll); initialTarget = Vector3.Forward; initialUp = Vector3.Up; initialRight = Vector3.Right; initialPosition = Vector3.Zero; //rotate the target initialTarget = Vector3.Transform(initialTarget, rotationMatrix); initialUp = Vector3.Transform(initialUp, rotationMatrix); initialRight = Vector3.Transform(initialRight, rotationMatrix); target = initialTarget + position; up = initialUp + position; right = initialRight + position; //move forward if (currentKeyboardState.IsKeyDown(Keys.W)) { position += initialTarget * 0.05f;target += initialTarget * 0.05f;right += initialTarget * 0.05f;up += initialTarget * 0.05f; } //move backward if (currentKeyboardState.IsKeyDown(Keys.S)) { position -= initialTarget * 0.05f;target -= initialTarget * 0.05f;right -= initialTarget * 0.05f;up -= initialTarget * 0.05f; } //strafe left if (currentKeyboardState.IsKeyDown(Keys.A)) { position -= initialRight * 0.05f; target -= initialRight * 0.05f;right -= initialRight * 0.05f;up -= initialRight * 0.05f; } //strafe right if (currentKeyboardState.IsKeyDown(Keys.D)) { position += initialRight * 0.05f; target += initialRight * 0.05f;right += initialRight * 0.05f;up += initialRight * 0.05f; } UpdateProjectionMatrix(); //This doesn't seem to work as expected... viewMatrix = Matrix.CreateLookAt(position, target, up); //I then draw some things using the view matrix...Here's the kicker: the only things that I am drawing right now are four points - one at the world's origin, and three more at the camera's initial target, up, and right vectors. The points behave just as they should. The initial target point rotates around the origin just like it should, as does the initial up and initial right vectors. It's when I plug things into the Matrix.CreateLookAt function that everything breaks down. Rather than rolling like it should, the camera behaves very strangely. When I look side to side (just changing the yaw), the camera rolls side to side as well as looks side to side. If I plug a value of (0.0, 1.0, 0.0) in for the Up vector on Matrix.CreateLookAt, it behaves just fine, but without any sort of camera roll.I can't for the life of me figure out what is causing this strange behavior. All the rotations seem correct when I render out the initial points. Is there something that I don't know and should know about Matrix.CreateLookAt? Shouldn't the Up vector in Matrix.CreateLookAt cause the world to roll around?I've got a thread over on the XNA forums, but haven't found a proper answer yet, so I figured I'd try asking the brains around here to see if any of you have any ideas on why it isn't working as it should.
There's no need to use CreateLookAt if you already have a matrix representing your camera's position. Just use CreateFromYawPitchRoll, set the position of the camera in the Translation property of the resulting matrix, and then invert it. Voila, you have a view matrix. ; Hmm, good call. I guess I was thinking that Matrix.CreateLookAt did something special. I'll have to play around with this more when I get home. ;Quote:Original post by MoeHmm, good call. I guess I was thinking that Matrix.CreateLookAt did something special. I'll have to play around with this more when I get home.Yeah it's not extremely obvious, but a view matrix is just the inverse of a "world" transformation. If you think about it makes sense: a world matrix takes something and transforms it from its local space to it's actual world position and orientation. A view matrix takes things that are in their world position and orientation, and transforms them to a coordinate space local to the camera.; Matt, you are totally right - it worked like a charm. Thanks a bunch!
Ninfa3D
Graphics and GPU Programming;Programming
I just discovered this wonderful engine called Ninfa3D.In short, this engine has the ease of use of Blitz3D but is much more powerful, featuring the Newton Physics engine, 1.0 to 3.0 shaders support, real time shadows (still need some work though), Post Processing effects and much more.It's still wip but it's already fully usable, plus it's totally free.Give it a shot here:http://www.mysticrealitystudio.comuv.comFeature List:BasicIt uses Irrlicht engine as base for graphics.Physic powered by Newton 2.0 Archemedia.OpenAL is used to provide compatibility with Windows XP and Windows Vista, as well as 2D and 3D sound.All in one .DLL which takes less than 2MB!!!.RenderingFast mesh rendering with OpenGL.Antialiasing.Anisotropic 16x.Shaders 1.0 - 3.0.Dynamic shadows using the stencil buffer.Multiple viewports rendering.TexturingBasic, Multi-texturing, Bump-, Normal-, Parallax-, Specular Mapping.Supported texture formats: .dds, .bmp, .jpg, .pcx, .png, .pm, .psd, .tga and .wal.PhysicsBasic Physics, Collision Detection, Rigid Body.Fast and accurate rigid body simulation with support for spheres, boxes, cylinders, convex hulls, and triangle meshes.Supports ball, hinge, slider, and universal joints.Physics-based vehicles with support for any number and configuration of tires. (coming soon)MeshesSkeletal Animation, Morphing, Animation Blending.Supported mesh formats: .3ds, .b3d, .obj, .lwo, .xml, .dae, .x, .ms3d, .my3D, .lmts, .bsp, .md2, .md3, .dmf, .oct, .csm, .stl.Meshes are linear interpolated from one frame to the next.Mesh collisions and intersection.ShadersVertex, Pixel, High Level.Supports vertex and fragment shaders ARB and high-level programs written in GLSL.Post-ProcessingDepth of field.Radial Blur.Motion Blur.Bloom.SoundSupport for WAV and OGG files.2D/3D sound.LanguagesBASIC.Image(can't seem to put it correctly):http://www.mysticrealitystudio.comuv.com/modules/gallery/albums/basuraXD/img/090607034634_dibujo2.jpg
[solved] SCons dependencies
General and Gameplay Programming;Programming
Hi,I'm trying to convert a project currently using make to SCons, since I've gotten tired of the current make-systems extreme brittleness. However, I'm a bit stuck on one part that someone here perhaps might be able to help me with.The project consists of a large amount of source files in various languages, and part of it is written in Modelica. Modelica-files are not compiled directly, but instead translated to C-code. The problem I have is that some C++-code depends on header-files that are created when translating the Modelica code. However, I want to be able to do a parallel build to speed up the build, and this breaks if the C++-code is compiled before or at the same time as the Modelica-code. I've tried to make the C++-code dependent on the Modelica-code, but I can't figure out how. Here is my current SConscript-file:import reimport os.pathImport('env')# A scanner for Modelica-filesinclude_re = re.compile(r'^protected\s+import\s+(\S+);$', re.M)def add_suffix_mo(filename):return filename + '.mo'def mo_file_scan(node, env, path):contents = node.get_contents()includes = include_re.findall(contents)return map(add_suffix_mo, includes)mo_scan = Scanner(function = mo_file_scan,skeys = ['.mo'])# A builder for Modelica filesrml_home = env['RMLHOME']def mo_build_function(target, source, env):for src in source:Execute('cd ' + str(src.get_dir()) + '; ' + rml_home + '/bin/rml -Eplain -ftrace ' + os.path.basename(str(src)))return 0mo_builder = Builder(action = mo_build_function,suffix = '.c',src_suffix = '.mo',source_scanner = mo_scan)# Create a new environment with the scanner and buildermo_env = Environment(BUILDERS = {'RML' : mo_builder})mo_env.Append(SCANNERS = mo_scan)# Create a list of files to be builtdont_include = map(File, Split('DAEEXT.mo Print.mo RTOpts.mo System.mo Parser.mo TaskGraphExt.mo Corba.mo Socket.mo ErrorExt.mo Settings.mo'))objs = [node for node in Glob('*.mo') if node not in dont_include];# Build the Modelica-files, and create an alias.mo_env.Decider('MD5')mo2c = mo_env.RML(objs)env.Alias('mo2c', mo2c)# Call the runtime-script, which compiles the C++-files. This should not be called until # after mo_env.RML(objs) is finished.runtime = mo_env.SConscript(['runtime/SConscript'])# Use Depends to try and make runtime dependent on mo2c. Doesn't work.Depends(runtime, env.Alias('mo2c'))It seems like SCons simply ignores the Depends-statement. I've tried every variation with and without aliases and depends I could think of, but can't get it to work. The SCons manual isn't very helpful in this matter either. I'm no expert on SCons, so I've probably misunderstood something about dependencies.EDIT: Ok, got it to work now. Emitter was indeed the way to go. I'm posting the working code below, since I hate it when someone claim to have solved a problem without showing the actual solution [smile]import reimport SCons.UtilImport('env')# A scanner for modelica filesinclude_re = re.compile(r'^protected\s+import\s+(\S+);$', re.M)def add_suffix_mo(filename):return filename + '.mo'def mo_file_scan(node, env, path):contents = node.get_contents()includes = include_re.findall(contents)return map(add_suffix_mo, includes)# An emitter for Modelica files. Compilation of a Modelica-file produces a .h and .c file as a side effect, so we need to inform SCons about that.def mo_emitter(target, source, env):base,ext = SCons.Util.splitext(str(source[0]))env.SideEffect(base + ".h", target)env.SideEffect(base + ".c", target)return (target, source)# A scanner for Modelica filesmo_scan = Scanner(function = mo_file_scan,skeys = ['.mo'])# A builder for Modelica files. Takes a list of .mo-files and produces # .o-files, using the previously defined emitter and scanner.mo_builder = Builder(action = "cd ${SOURCE.dir} && $RMLHOME/bin/rmlc -Wr,-ftrace -c ${SOURCE.file}",src_suffix = ".mo",suffix = ".o",single_source = True,emitter = mo_emitter,source_scanner = mo_scan)env.Append(BUILDERS = { "RML" : mo_builder })dont_include = map(File, Split('DAEEXT.mo Print.mo RTOpts.mo System.mo Parser.mo TaskGraphExt.mo Corba.mo Socket.mo ErrorExt.mo Settings.mo'))objs = [node for node in Glob('*.mo') if node not in dont_include];env.RML(objs)# Call the SConscript for runtime. No need to explicitly state dependencies, # since SCons figures them out automagically!env.SConscript(['runtime/SConscript'])[Edited by - Perost on June 27, 2009 11:30:14 AM]
Agreed that the docs are not great.Depends() takes two filenames or targets as arguments. I don't think you can pass entire environments in. SCons doesn't think of environments as separate build steps. So you'd have to do a Depends call for every involved filename.So you say that the Modelica tool produces header files? The Builder definition you have only says that it produces ".c" files.. are those the same thing or does it make other files? If it makes other files, then you need to tell SCons about how those other files are created. I think you can do that with an Emitter.One good debugging method, is that you can call SCons with just a filename of something you want to build. So if you call it like this:scons <path to a Modelica-produced header file>then you can find out if SCons knows how those files are produced. ;Quote:Original post by pinacoladaAgreed that the docs are not great.Yeah, the docs could use some work. A pity, since SCons is a nice tool (at least compared to make [rolleyes]).Quote:Original post by pinacoladaSo you say that the Modelica tool produces header files? The Builder definition you have only says that it produces ".c" files.. are those the same thing or does it make other files? If it makes other files, then you need to tell SCons about how those other files are created. I think you can do that with an Emitter.Modelica produces both a .c and .h file, but I didn't know how to tell SCons that. Perhaps Emitter is what is needed, I'll check it out.Quote:Original post by pinacoladaOne good debugging method, is that you can call SCons with just a filename of something you want to build. So if you call it like this:scons <path to a Modelica-produced header file>then you can find out if SCons knows how those files are produced.Ok, good to know. Thank you for your help!
Collision detection with rotating objects
Math and Physics;Programming
Hey there,i'm coding a 3D particleenginge. these particles are able to collide with models.for the collision detection i'm using the polygons of the model. what i got is the collision with moving objects(translation) and i even take notice of the objects speed so i can transfer this speed to a particle that collides.problem now is how to handle rotation (its not a problem to rotate the object and then collide!! - its a problem to take notice of the speed the object has at the position of collision)is there something like a tutorial that discribes the collision for rotating objects with a correct transfer of energy between them? some hints?for example i had a problem with the following:as you can see, the object has different speeds of rotation at different positions. so somehow i have to pic the right speed for each position.thanks & greezseilz
good C/C++ book for beginners?
Engines and Middleware;Programming
hello,I am new to C++ and i am searching for a book to learn C++. Can any of you recommend and good books to buy from say Amazon or somewhere that can teach me C++. Thank youStephen
http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_13?ie=UTF8&s=books&qid=1245951867&sr=8-13go there and look at the first review... he lists a bunch of good books.I personally can't recommend any because the covers change and it has been a while.Might be better off posting this in beginner forum, or software engineering forum.
Reference to Abstract Base Class
General and Gameplay Programming;Programming
Hello to all, i would like to store a abstract base class in context class then based on the type being instantiated and called the concrete strategy algorithm.Is this possible ? #ifndef ENCRYPTOR_H #define ENCRYPTOR_H#include <boost/shared_ptr.hpp>#include "EncryptionStrategy.h"// Context in UML diagramclass Encryptor{private: boost::shared_ptr<encryptionStrategy> anEncryptor; public: Encryptor(); ~Encryptor(); void encrypt();};/*C++ Implementation Variation1. Constructor takes strategy pointer2. Constructor takes null strategy pointer and create default concrete strategy3. Template parameter*/#endifEncryptor::Encryptor() : anEncryptor(boost::shared_ptr<encryptionStrategy>(new encryptionStrategy()) {}Thanks.Please help.EDIT:Constructor also can takes an abstract pointer then which indirectly return to concrete base class type. class encryptionStrategy is a strategy pattern abstract base class which derived from many concrete strategy class.I want to initialized anEncryptor without client passed the appropriate pointer to class Encryptor constructor.How to solve it ?Thanks.
I looking for alternative approach where doesn't require to create strategy object in main and passes it to encryptor constructor. Perhaps i was wrong but learning from mistake is kind of experience. Hope someone can explain overall strategy pattern and my coding style.Thanks for your help. ; I don't fully understand the question but ...It looks to me that you want to look into templates.Perhaps the "Curiously Recurring Template Pattern" could do the trick.http://en.wikipedia.org/wiki/Curiously_Recurring_Template_PatternOr you you can create classes that derive from encryptionStrategy (which then becomes the base class) and have different implementations for the desired occasion. ; If you want the base class to have a default implementation/strategy, you're just going to have to pick a concrete strategy class and instantiate it directly in the initializer list.But what's the point of using the strategy pattern, if there's only ever going to be one strategy? ; OK, Thanks for your reply. I misunderstood the strategy pattern and i thought i not need to instantiate concrete strategy pattern and pass to encryptor. Now i was wrong. How about i don't want to uses dynamic allocated memory to initialize the encryptor member insted of some smart pointer ? Thanks. ;Quote:Original post by Peter_APIITHow about i don't want to uses dynamic allocated memory to initialize the encryptor member insted of some smart pointer ? Thanks.What?
Picking with XNA
Graphics and GPU Programming;Programming
I'm trying to convert screen coords into 3D coords. I've been looking at some tutorials but can't seem to get it right. From trial and error, I know that 2D coords (0, 0) equals 3D coords (340, 165, Z). Whenever I unproject using (0, 0, Z) I get a vector3 very close to (0, 0, Z) back instead of something like (340, 165, Z). My code is below. Viewport viewport = new Viewport(); viewport.X = 0; viewport.Y = 0; viewport.Height = Game1.BackBufferHeight; viewport.Width = Game1.BackBufferWidth; viewport.MinDepth = 1; viewport.MaxDepth = 1500; Matrix _cameraViewMatrix = Matrix.CreateLookAt( new Vector3(0, 0, -540), new Vector3(0, 0, 0), Vector3.Up); Matrix _cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45.0f), //how wide the camera sees viewport.AspectRatio, 1.0f, //near clipping plane 10000.0f); //far clipping plane Vector3 nearSource = viewport.Unproject(new Vector3(0,0,-50), _cameraProjectionMatrix, _cameraViewMatrix, Matrix.Identity);What am I missing that is giving me the wrong results?
It seems like the near point isn't enough. I've been trying another approach, but still with no luck. Viewport viewport = new Viewport(); viewport.X = 0; viewport.Y = 0; viewport.Height = Game1.BackBufferHeight; viewport.Width = Game1.BackBufferWidth; viewport.MinDepth = 1; viewport.MaxDepth = 1500; Matrix _cameraViewMatrix = Matrix.CreateLookAt( new Vector3(0, 0, -540), new Vector3(0, 0, 0), Vector3.Up); Matrix _cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45.0f), //how wide the camera sees viewport.AspectRatio, .01f, //near clipping plane 10000.0f); //far clipping plane //pos holds 2D screen coords pos.Z = 0; Vector3 nearSource = Session.ScreenManager.GraphicsDevice.Viewport.Unproject(pos, _cameraProjectionMatrix, _cameraViewMatrix, Matrix.Identity); pos.Z = 1; Vector3 farSource = Session.ScreenManager.GraphicsDevice.Viewport.Unproject(pos, _cameraProjectionMatrix, _cameraViewMatrix, Matrix.Identity); float x, y, t; t = (0 - nearSource.Z) / (farSource.Z - nearSource.Z); x = nearSource.X + (farSource.X - nearSource.X) * t; y = nearSource.Y + (farSource.Y - nearSource.Y) * t;The 3D space x and y are still way off. ; This code works for me:D3DXVECTOR3 MousePos(int x, int y){D3DXMATRIX pm, vm, wm;D3DVIEWPORT9 vp;device->GetTransform(D3DTS_VIEW, &wm);device->GetTransform(D3DTS_VIEW, &vm);device->GetTransform(D3DTS_PROJECTION, &pm);D3DXMatrixIdentity(&wm);device->GetViewport(&vp);D3DXVECTOR3 p1;D3DXVec3Unproject(&p1, &D3DXVECTOR3((float)x, (float)y, (float)vp.MinZ), &vp, &pm, &vm, &wm);D3DXVECTOR3 p2;D3DXVec3Unproject(&p2, &D3DXVECTOR3((float)x, (float)y, (float)vp.MaxZ), &vp, &pm, &vm, &wm); float mouse_y = 0.0f;float mouse_x = ((mouse_y-p1.y)*(p2.x-p1.x))/(p2.y-p1.y) + p1.x;float mouse_z = ((mouse_y-p1.y)*(p2.z-p1.z))/(p2.y-p1.y) + p1.z; return D3DXVECTOR3(mouse_x, mouse_y, mouse_z);}; In the second example you made your near clip even closer to the camera. You should do the opposite, and try making 10 or more. You may be getting inaccuracy because the ray being cast is very short compared to the distance of objects.
passing a bool value in vertex structure
Graphics and GPU Programming;Programming
I need to pass a bool-value in my vertex structure. The structure contains only a Vector3 for POSITION0 and this bool value. Is there a semantic for a single bool value?Or do you have any other idea on how to achieve my goal?I'm basically trying to pass a value which indicates if a vertex is being selected. In that case it needs to have another color, which I set in the shader.
Use a float to indicate the influence of the selection color.Vec4 outColor = Lerp(normalColor, selectionColor, selectionColorWeight);The float can be 0.0 or 1.0 if you want to obtain binary control. ; You could change it to a Vector4 input for position, and put a 0.0f or 1.0f in the W componentOr try to pack it in some other input attribute similarlyOtherwise you'll just have to add another attribute ; Yeah having a float indicating a 0 or 1 value is a way. But I usually want to save as much space as possible. 10.000 vertices would have a total amount of 40.000 bytes on my graphics card, where I actually only need 5.000 bytes. And I want to save as much memory as possible. ; Shaders / GPU's work with floats/vectors, not bytes or bools. 10.000 vertices won't take 40.000 bytes by the way, even more :)If you use 32 bit floats for your vectors (which is common, I don't think you can change that), each vector component already takes 4 bytes:vector3 = 3x4 = 12 bytes per vertexvector4 = 4x4 = 16 bytes per vertexIn addition, bools aren't stored as 1 bit on a normal CPU either. On PLC's maybe, but for the CPU its just a byte. The reason is that CPU's are better with bytes than bits. A 32-bit CPU preferes 32 bit values. It's ta memory versus performance trade off.If you use the vector.w for the binary value, you need 16 x 10.000 = 160.000 bytes (if you use tenthousand vertices)... Which is only 157 kb. I wouldn't worry about it. I also pass thousands and thousands of vertices that also include tangents, texcoords, normal, biTangents, materialProperties, blend values, and so on. Only if you plan HUGE worls or very-high polygon models, you might think again. But ussually they fix that just by not rendering everything at the same time and/or LOD.Anyway, you can store the bool as a single bit by using bit shifting or masking. For example, bit 0 from the 32-bit vector.w 'carrier' will hold your bool. I'm not 100% sure, but I thought shaders also have bit shift functions to peel that single bit out of a bigger number. Or you can stuff bytes into a bigger 32 bit number and unpack them later on in the shader. So you can store 4 small numbers into 1 big number.Unpacking requires some extra energy from your shader of course, plus it doesn't save memory unless you can store that bit together with other values. If you have 4 bool values, it might be worth trying to pack them as 4 bytes into the vector.w component, instead of using 4 seperate float values.Greetings,Rick ; I actually meant that 10.000 vertices need 40.000 bytes only for the additional float values. I only need 1 bit, but I have to waste another 31 on it. That's my problem.40kB might not be that much, but I'd like to keep the used memory as little as possible anyways. I always thought that game programming is about optimizing everything as good as I can.My question seem answered.spek you brought up another 2 questions which seem a bit offtopic in here, but I'll take the risk:Quote:vector3 = 3x4 = 12 bytes per vertexvector4 = 4x4 = 16 bytes per vertexI've seen this too often. Why would I store a Vector3 value as a float4 in the shader? There are 3 floats, not 4. Am I waisting another byte there? ;PQuote:In addition, bools aren't stored as 1 bit on a normal CPU either. On PLC's maybe, but for the CPU its just a byte. The reason is that CPU's are better with bytes than bits. A 32-bit CPU preferes 32 bit values. It's ta memory versus performance trade off.Does this mean that if I have many many bits separately, it will take 32 bits for each, even though 31 aren't used? And is it more useful to take some bits together like in a struct to safe this memory?Don't call me a peanut counter. I'd just like to know the full background here ;)Thanks. ; The reason that the GPU goes not into bits or bytes is because of its architecture. In 99% of the cases, it works with floats & vectors, so its specialized on that. Just like a 64 bit CPU likes to work with int64 or double datatypes. Yep, that can be considered as a waste, but therefore we keep adding more and more memory. I think performance is ussually more important than memory for high-speed/realtime applications such as games.About using a float4... good question. Maybe ite laziness or it might become usefull some day. But maybe it also helps optimizing a little bit. I'm really not sure about what I'm about to say now, but if you look at shader Assembler code, it seems that the GPU 'work registers' are float4 types. So in the end your float2 or float3 will be used in a float4 anyway. Just like when you add 2 bytes, the CPU still uses 2 32-bit registers. Still odd though, since passing bigger vectors means using more memory, but also a larger "transfer cost" (bandwidth, etc.). Anyway, I try to keep the vectors compact as well, but maybe someone here can go deeper into the GPU architecture and explain this...As for the other 'bit' question, I believe BOOL's are stored as a single byte (8 bits) by default. The C language doesn't even have a BOOL by default if I remember correctly. So yes, if you have lots of BOOL's it can be worth packing them together into a byte or another format. 8 BOOL's = 8 bytes, while you could also store them into a single byte. The downside is that it takes more work to read and write these bits. Nice for the memory usage, not that nice for the performance. Before packing them, first ask yourself if its really worth the trouble. Especially if you need those bits very often.Rick;Quote:8 BOOL's = 8 bytesI guess you mean 8 bools = 8 bits = 1 byte.Quote:So in the end your float2 or float3 will be used in a float4 anyway.When I pass texture coordinates, I would use float2. Do I have to use float4 as well because of what you wrote? Is there any case where I need to pass another type than float4 when I want to pass floats? ; 8 bits = 1 byte, but since BOOL's are actually stored as bytes, 8 BOOL's make eight bytes. Unless you specifically pack them all together into 1 byte (with bit shifting or something).As for the texcoords, I ussually pass them as float2 as well. But since you asked why some programs are using all four components, I was looking for an explanation. I wouldn't store texcoords into a float4 structure since 50% of the memory and bandwidth usage would be wasted. But, once the shader starts working with them it could still use float4 registers to temporarey store these (smaller) numbers in. However, don't confuse working registers with memory. CPU's and GPU's have a small set of 'slots' that are temporarely used for doing calculations such as adding, subtracting or in the case of GPU's; normalizing, matrix multiplies and dot products. Maybe, very maybe, it takes less energy to port float4 values that come into the vertex/fragment shader towards the work registers. I doubt it though... Like I said, this requires a deeper knowledge of the GPU architecture, which I don't have :) For now I would just pass the coordinates like you are already doing.Ow, I forgot to mention that some coordinate systems might actually use all 4 components (xyz and w). If you don't pass the W component it will get a default value. But it could be used for scaling, or in case you have 2 sets of texture coordinates. For example, xy = texcoord.xy, zw = lightMapTexcoord.xy.
warning C4700: uninitialized local variable 'min and max' used,
For Beginners
well first of all i was having a problem with a few errors but i have gotten them fixed in the mhgean time but no it come to the warnings that i am getting using local variables, but so far my program compiles successfully but i keep getting the following warnings and i cant seem to find whats wrong with them.If someone could help i would greatly appreciate it and i am also getting a runtime error also from this matter but here are the warnings that i am getting.warning C4700: uninitialized local variable 'min' usedwarning C4700: uninitialized local variable 'max' usedso here is my source code for you to look at and reference to if need be// Author:James M. Neal// Assignment: CIS 251 Assignment 4// File: assign4.cpp// Purpose: Searches a file of numbers of type int and writes the largest and// smallest numbers to the screen. Allows the user to repeat action// with other files.// and allows you to find the average of the class of numbers and outputs them to the screen.// Input: Name of file to be processed. Class1.txt, Class2.txt, Class3.txt, and Class4.txt#include <iostream>#include <fstream> // I/O#include <iomanip> // For setw()using namespace std;ofstream outputfile("output.txt");const int MAX_FILE_NAME = 35; // Maximum space allocated for file namevoid open_input(ifstream& input, char name[]);// Get file name & Open filevoid find_max_min(ifstream& input, int& max, int& min); // Find max & min valuesdouble find_average(ifstream& input); // Finds averagevoid output(const char name[], int max, int min, ostream& os = cout); // Print resultsint main() // Parameters: None// Returns: Zero// Calls: open_input(), find_max_min(), output(){ char again; // Does user want to go through loop again? char file_name[MAX_FILE_NAME + 1]; // Name of file to be processed ifstream input_numbers; // For working with input file int max; // Maximum and minimum numbers from file int min; double average; cout << "This program can find the largest and smallest numbers in a file\n" << "of integers.\n" << endl; system("pause"); // Hold message on screen until key is pressed do { system("cls"); // Clear screen open_input(input_numbers, file_name); // Get file name & open file // find_max_min(input_numbers, max, min); // Find max & min values in fileaverage = find_average(input_numbers); input_numbers.close(); // Close file output(file_name, max, min); // Print results on screen output(file_name, max, min, outputfile); // Print results on outputfile cout << "\nDo you want to process another file (Y/N)? "; cin >> again; cin.ignore(256, '\n'); // Remove Enter key from keyboard buffer } while ( again == 'y' || again == 'Y'); cout << "\nEnd of Program!" << endl; outputfile << "\n\nThanks for using MaxMin!\f"; outputfile.close(); return 0; } // End of main()void open_input(ifstream& input, char name[]) //Open file, exit on error// Parameters: Variables for input file reference and input file name// Returns: None// Calls: None{ int count = 0; // a count number of tries do // Continue until we get a valid file name and can open file { count++; if (count != 1) // Issue error message if we are trying again. { cout << "\n\aInvalid file name or file does not exist. Please try again."<< endl; } cout << "\nEnter the input file name (maximum of " << MAX_FILE_NAME << " characters please)\n:> "; cin.get(name, MAX_FILE_NAME + 1);// Gets at most MAX_FILE_NAME characters cin.ignore(256, '\n'); // Remove Enter key from keyboard buffer input.clear(); // Clear all error flags, if any, from prev try input.open(name, ios_base::in); // Open only if file exists } while (input.fail() ); // If can't open file, try again} // End of open_input()void find_max_min(ifstream& input, int& max, int& min) // Find max & min values// Parameters: Variables for file reference and max and min values// Returns: None// Calls: None{int value; // Value from file input >> value; // Reads first value max = min = value; // Initialize max & min to first number while (input >> value) // Continue as long as we can read a number from file. { if (value > max) max = value; if (value < min) min = value; }} // End of find_max_min()double find_average(ifstream& input)// Parameters: Variables for file reference and max and min values// Returns: None// Calls: None{ double value= 0; // Value from file double sum = 0; int count= 0; // Initialize max & min to first number while (input >> value) // Continue as long as we can read a number from file. { sum += value; count++; } return sum/count;}void output(const char name[], int max, int min, ostream& os) // Print results// Parameters: File name, max & min values from file, output stream// Returns: None// Calls: None{ os << "\n\nInput File Name : " << name << endl; os << "Largest Number in File : " << setw(8) << max << endl; os << "Smallest Number in File: " << setw(8) << min << endl;} // End of output()also the runtime error is the following:Run-Time Check Failure #3 - The variable 'min' is being used without being defined.Run-Time Check Failure #3 - The variable 'max' is being used without being defined.thanks for any help that i can get[edit: source tags are your friend -SiCrane]
The computer is telling you what the problem is. You have variables max and min and you're trying to use them without have first given them some value. The fix is to give them some value before you use them. ; Since you commented the call to find_max_min, variable max and min was not initialized with any value, so they have just random values in them, this is what the warning trying to say. ; The call to find_max_min() is commented out, so min and max are never set before you try to write them in the output() function. ; but how would i need to fix this problem and what should i do to solve the runtime errors also cause i am trying to find the average of a set of number in a text file that i have created ; SiCrane told you the answer, just give them some initial values, like 0. ; when i give them a value of zero my answer is returned as zero so i have tried the following:max !=0 min!=0 when i try this i get several errors that produce after that is initialized what should be done to prevent this from happening ; Uncomment this line if you wish to find the max and min value:// find_max_min(input_numbers, max, min); // Find max & min values in file; when i do that my program will not build correctly after that line is uncommented so what should be done for it to link orrectly after the line is uncommented ; You fix it, by fixing the error that the compiler or linker gives you when the program does not build correctly.Also, we don't do homework on this forum. Specific, directed questions like your original post are sometimes acceptable, but at this point you are not demonstrating to me any sort of initiative in solving your own problem. Please read this.Closed.
file converter
For Beginners
Hican some one help please/I want to convert my 3ds file to isx.Thanks
You could try 3D Object Converter, I don't know if it can convert to isx though... ; One solution you can try if you can't convert something from 3ds to isx, you could look into the free converter for direct-x to convert 3ds files to .x files, and maybe you could find something to convert a .x file to a isx? (just throwing that out there) I have never heard of isx personally. ; sorry XSI file ; this might helphttp://www.edharriss.com/tutorials/tutorial_xsi_UV_convert/convert%20_UVinfo.htm
Outline Fonts
Graphics and GPU Programming;Programming
I'm trying to use outline fonts in OpenGL. I read the tutorial at nehe.gamedev.net, but I still have many questions...If I use 96 characters, 32 to 127, can the GLYPHMETRICSFLOAT array have 96 elements? Or I'll have to have 127 elements?If I draw text at a position given by glTranslatef() [used before glCallLists()], will the given y value be the text's bottom or top?How do I calculate the total height of a drawn character sequence (that can include '\n' ) ?Can I create a font of size 1 and then be able to use the font with any size by using glScalef(fontsize,fontsize,1.0f) ?[Edited by - Tom Backton on June 27, 2009 1:36:29 AM]
Recently tinkered with the Freetype library and have found a lot to like there. FTGL is based on it and would seem a no-brainer... were it not for some attachments to deprecated features (e.g. attribute stacks). Not terribly difficult to get the basics rolling directly from Freetype. The package comes with ample docs and a couple of example progs to get you up speed.If you're tired of farting around with platform specific font code this might be the ticket for you. ; I'm not tired... I just need some information. I'm not the only one who uses OpenGL outline fonts, right? I'm sure someone knows the answers. ; Can someone please help me by answering (at lease one of) the questions? (Does nobody use outline fonts?)Help will be highly appreciated :) ;If I use 96 characters, 32 to 127, can the GLYPHMETRICSFLOAT array have 96 elements? Or I'll have to have 127 elements?Your array can be 96 elements. However, element 0 will correspond to character 32, so you will need to take this into account when using it in future code.If I draw text at a position given by glTranslatef() [used before glCallLists()], will the given y value be the text's bottom or top?Without trying this in practice, I believe it will be at the text's top.How do I calculate the total height of a drawn character sequence (that can include '\n' ) ?I'm not sure, since font sizes are in points, whereas you will want it in Pixels. However, I've found them to be not that disimilar.Can I create a font of size 1 and then be able to use the font with any size by using glScalef(fontsize,fontsize,1.0f) ?Yes, but it will look horrific. ;Quote:Can I create a font of size 1 and then be able to use the font with any size by using glScalef(fontsize,fontsize,1.0f) ?I'm assuming you're referring to this function, wglUseFontOutlines(). This function ignores whatever font size you pass to it, so, you will have toscale it to whatever size you need. The last time I looked at it, I couldn't find a clear way to scale it to a specific point size, like 12.In your glScalef() example, fontsize != pointsize. Scaling factor needs to be in some kind of device coordinates.And since wglUseFontOutlines() creates the font as polygons and not as a texture, you will have issues dealing with anti-aliasing.You would need to turn on multi-sampling or render it to a texture before drawing it to the backbuffer.[Edited by - theequal on June 24, 2009 2:29:25 PM]; Thanks for the answers! But I have another question...I decided to use texture fonts since they are faster and don't depend on the existence of the fonts on the user's computer (because the texture is created by the game creator, not during runtime).I'll probably use a long texture with the 96 characters in one row. And there will be a display list for each character. The x increment after each character will be taken from the gmf array (I'll create the texture by drawing character outlines on the screen and using glCopyTexImage2D() ). The question is : what is the y difference between lines? Is it constant? How do I calculate it? ; If you are using a premade texture, wouldn't you already know what the height of each char is? I would keep the same height for each character. The width can vary. ; I do know what the characters' height is, but I need to know the y difference between LINES. I CAN read it from a file, but I'm also programming the font texture CREATOR, so I need to know which height I need to write to the font file.I read a Freetype OpenGL example at nehe.gamedev.net , and the y difference between lines there is H/0.63 ; H is the characters' height. Is it a standard number? Is there a standard or I can simply choose a number for which multiline text looks natural? ; Check the Freetype documentation. I remember there being a way to get the baseline information from the font itself, as it was designed to be typeset. Advancing baseline based on character size is, in general, dangerous, as different characters are of different size, and some characters may even (by design) extend into adjacent lines of text.
DX9 Displacement mapping
Graphics and GPU Programming;Programming
I have read all the documentation on tessellation and displacement mapping in the DX Docs, but I still don't fully understand how you would implement it. I am assuming that Pre-sampled/normal displacement mapping is part of the fixed-function pipeline, specifically the tessellator. So if I'm correct on that, then how/what can you customize with the tessellation process? I'm also under the impression that you have to set UV coordinates for the displacement map in the vertex buffer somewhere. Also do you supply tessellation factors in the vertex buffer too? Basically though, I want to tessellate meshes while supporting early SM2.0 cards. One more question is, do pre-sampled displacement mapping do adaptive tessellation?So can someone better explain how this better,Thanks,Mikfig
Take a look at Frank Luna's "Intro. Direct3D 9.0c: A Shader Approach" book. There's a nice explanation about Displacement Mapping. You can find the demo code on book's website as well. ; Yes I have read this portion of his book, but it only explains using the displacement map as a height map. But does DX9c not support using the displacement map to tessellate meshes? I am referring to this part of the DX docs: DX Graphics -> Direct3D9 -> Programming Guide -> Advanced Topics -> Vertex Pipeline -> Displacement Mapping ; No DX9 does not tesselate meshes for you.The way to do displacement mapping is by using a vertex texture fetch...you must have a mesh already tesselated the desired vertex density. To be honest vertex textures are more useful for things like terrains and special effects. ; It should be noted that VTF is only supported by SM3.0 cards and higher. ; So just to get this completely straight, there is NO WAY AT ALL to tessellate meshes on the GPU using DX9. ; no there is no way to tesselate meshes on the GPU in DX9.; K, thx for responding to all my questions. Now I just have to find a good discrete LOD algorithm for general meshes. Time to read more into that LOD book. ; I just found this page in the DirectX docs that specifically mentions tessellation in DirectX 9, and I quote, "The tessellator unit has been enhanced. You can now use it to: * Perform adaptive tessellation of all higher-order primitives."So now I just have to figure out how to use the tessellator unit.;Quote:Original post by mikfigI just found this page in the DirectX docs that specifically mentions tessellation in DirectX 9, and I quote, "The tessellator unit has been enhanced. You can now use it to: * Perform adaptive tessellation of all higher-order primitives."So now I just have to figure out how to use the tessellator unit.i think it is restricted to caps thought, which means not all cards have this features as default.New hardware caps:D3DDEVCAPS2_ADAPTIVETESSRTPATCH // Can adaptively tessellate RT-patches D3DDEVCAPS2_ADAPTIVETESSNPATCH // Can adaptively tessellate N-patches
Blitzmax for somebody new to programming?
For Beginners
Hey guys, I guess the title says it all. I am new to programming, I fancy getting into making some small little games, and you never know in a few years time making some little Indie titles, nothing too crazy.I have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics.Would this be a fair estimation? I feel like if I spend my time learning Blitz, then I am not really learning core programming techniques, instead learning how to manipulate the library. One example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle. Would I be better off getting my feet wet with something like Python->pygame? How does pygame present itself to someone who would be new to programming? Or maybe something like C-Allegro?Thanks guys.<Sorry for my terrible and rushed grammar. Trying to get the post in before my net disconnects>
I haven't had any experience with Blitzmax but back when I began programming I got a book on a version of the Blitz language and really disliked it (and I was a beginner back then).I personally would suggest XNA Game Studio by Microsoft. XNA is a wrapper over the DirectX framework to heavily simplify game development. It utilizes the C# language so you would have to learn that, but you mentioned wanting to learn "core programming techniques" and you can do that with something like C#. Take some time learning C# and then move into XNA slowly, making sure you understand what you're writing. You can find XNA's website here.Whichever language/library you choose I would suggest learning the core language first. Game development is typically a difficult programming field (lots and lots of techniques) and even though there are loads of tools out there created to make creating games easy, most will require some basic knowledge of core programming techniques. ;Quote:Original post by KanchoI have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics. Would this be a fair estimation?Not really, no. There are users of all skillsets using BlitzMax. Some are experienced, some are beginners. It's a hell of a lot less intimidating, obscure and labyrinthine than C++, which is good for beginners. It's true that - much like C# and Java - it's design emphasis is on making coding fun and quicker than certain other languages, but it's certainly not true that you need to be an experienced programmer to appreciate any of that.Quote:Original post by KanchoOne example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle. That's an example of the precise opposite of what you claim. cin isn't part of the C++ language, it's part of the iostream library. Also, BlitzMax does have such a command. It's called Input, and it's well documented in the help files.Quote:Original post by KanchoI feel like if I spend my time learning Blitz, then I am not really learning core programming techniques, instead learning how to manipulate the library. Would I be better off getting my feet wet with something like Python->pygame? Or maybe something like C-Allegro?Well not if you're intent on "learning core programming techniques" and avoiding "learning how to manipulate a library" since PyGame and Allegro are both libraries. Frankly, I'm not sure I see the distinction. There's not much you can do with any programming language without learning to manipulate libraries, particularly for game development. If you were learning C++, I'd expect that learning about the STL (Standard Template Library) would be a big part of that.Not to appear discouraging, but if you're finding BlitzMax too difficult, I can't see you having an easier time with Python or C. It sounds to me as though your real problem is that you want to be rushing through the basics far quicker than anyone really can when they're starting out, and you're getting frustrated at the lack of progress. Lack of progress is normal when you're learning, as is getting frustrated by it. You really have two options. Either stick with it and keep going until you get there, or find something with a completely different paradigm. Switching languages won't help you at this stage, it'll just make things even slower as you have to start all over again. Not to mention unlearning some of the things you just learned. If you want to switch paradigms, then consider something like GameMaker, Flash or MultiMedia Fusion, where you can get stuff up and on screen without actually having to learn much programming. Then you can come back to BlitzMax, C or Python when you've picked up some experience with that. ; I use Blitz 3D at the moment and while great for prototyping and making simple/dirty games it's not something I'd want to keep doing for much longer.That said I migrated from there to some basic C++ (shown below although I'd say its some pretty poor quality code and it's for a cross platform system) in about a week or two, once you've learned one language others come pretty quickly although I've forgotten much of it almost as quickly.It's a good language to start with though if you're interested with games design as you can really get to grips with algorithms such as game physics pretty quickly.#include <KD/kd.h>#include <KD/KHR_float64.h>#include <vector>#include <algorithm>#include <GLES/gl.h>EGLDisplay display = EGL_NO_DISPLAY;EGLSurface windowSurface = EGL_NO_SURFACE;EGLContext context = EGL_NO_CONTEXT;static KDboolean setupEGL();static void releaseEGL();class Plane {public:void UpdatePlane(); //Updates variablesfloat worldX, worldY; //Position of plane on a 'world' scale rather than on screen, 1 unit = 1mfloat bearing; //Y axis is effectively Northfloat velocity; // 1 unit is 30m/s (108kph) KDboolean firing;KDust waitFireTimer;/* Notes: * A Spitfire MkV's max speed is around 600kph * A good cruising speed for a sea plane would be around 400kph*/};void Plane::UpdatePlane() {//Update the Plane's positionfloat plusX, plusY;plusX = velocity * kdSinKHR(bearing);plusY = velocity * kdCosKHR(bearing);worldX += plusX;worldY += plusY;if (firing == KD_TRUE) {if (kdGetTimeUST() > waitFireTimer + 1000000000/5) {kdLogMessage("Fired. ");waitFireTimer = kdGetTimeUST();}}}class PlayerPlane : public Plane {public:PlayerPlane(float x, float y, float a);};PlayerPlane::PlayerPlane(float x, float y, float a) {this->worldX = x;this->worldY = y;this->bearing = a;this->velocity = 4;this->firing = KD_TRUE;this->waitFireTimer = kdGetTimeUST();}class EnemyPlane : public Plane {public:EnemyPlane(float x, float y, float a, float v);//Most of this is AI stuff};EnemyPlane::EnemyPlane(float x, float y, float a, float v) {this->worldX = x;this->worldY = y;this->bearing = a;this->velocity = v;}class Bullet {public:void UpdateBullet(); //Updates variablesBullet(float x, float y, float a, float v);float worldX, worldY; //Position of plane on a 'world' scale rather than on screenfloat bearing; //Y axis is effectively Northfloat velocity; };Bullet::Bullet (float x, float y, float a, float v) {this->worldX = x;this->worldY = y;this->bearing = a;this->velocity = v;}void Bullet::UpdateBullet() {//Update theBullet's positionfloat plusX, plusY;plusX = velocity * kdSinKHR(bearing);plusY = velocity * kdCosKHR(bearing);worldX += plusX;worldY += plusY;}class Factory{private:static std::vector<Bullet *> allBullets;static std::vector<Plane *> allPlanes;public:static Bullet *createBullet(float x, float y, float a, float v){Bullet *bullet = new Bullet(x, y, a, v);allBullets.push_back(bullet);return bullet;} static EnemyPlane *createEnemyPlane(float x, float y, float a, float v){EnemyPlane *plane = new EnemyPlane(x, y, a, v);allPlanes.push_back(plane);return plane;}static PlayerPlane *createPlayer(float x, float y, float a){PlayerPlane *plane = new PlayerPlane(x, y, a);allPlanes.push_back(plane);return plane;}static void forEachBullet(void (*f)(Bullet *p)){std::for_each(allBullets.begin(), allBullets.end(), f);}static void forEachPlane(void (*f)(Plane *p)){std::for_each(allPlanes.begin(), allPlanes.end(), f);}};std::vector<Plane *> Factory::allPlanes;std::vector<Bullet *> Factory::allBullets;static KDTimer *timer;static void quit_callback(const KDEvent *e);static void timer_callback(const KDEvent *e);static void input_callback(const KDEvent *e);static void updateAllPlanes(Plane *p);static void updateAllBullets(Bullet *p);static void *gametimer;#define NANO_SECS_PER_SECOND 1000000000;static KDboolean keys[5];void *player;#define KEY_FIRE 0;// Main Program// ##################################################################KDint kdMain(KDint argc, const KDchar *const *argv){player = Factory::createPlayer(0,0,0);setupEGL();const KDEvent *e;/* set up a timer to redraw 30 times a second */KDint64 interval = (KDint64) 1000000000 / 30; timer = kdSetTimer(interval, KD_TIMER_PERIODIC_AVERAGE, gametimer);/* main event loop. */if (timer != KD_NULL) {/* Initialise Timer, Quit and Input callbacks. */kdInstallCallback(timer_callback, KD_EVENT_TIMER, gametimer);kdInstallCallback(quit_callback, KD_EVENT_QUIT, KD_NULL);kdInstallCallback(input_callback, KD_EVENT_INPUT, KD_NULL);while ((e = kdWaitEvent(-1))) {kdDefaultEvent(e);}}/* Deinitialise context */releaseEGL();return 0;}Unfortunately the OOP in Blitz is very simple, effectively a stack of structs, i.e each class only has variables attached to it, no operations, and no sub-classesAlso the same game in B3D (note C++ version was no-where near completed and I cut half of it out while this is the full game) And this is cruddy code, don't copy it; I managed to get a memory leak in Blitz somehow.Global GfxW = 640Global GfxH = 480Include "Menu.bb".NewGameGraphics GfxW,GfxH,0,1SetBuffer BackBuffer()ClsColor 0,67,171AutoMidHandle TrueSeedRnd MilliSecs()Type PlayerField X#,Y#,A,F#,Z#,H,LEnd TypeType BulletField X#,Y#,A,S,LEnd TypeType CloudField X#,Y#,SEnd TypeType EnemyField X#,Y#,A,R,Z#End TypeType ExplosionField X#,Y#,FEnd TypeType CarrierField X#,Y#,A,P,S,R,HEnd TypeConst Rotations = 90Global ShellExplosion = LoadImage ("Images/ShellFire.bmp")Global LandImg = LoadImage ("Images/Land.bmp")Global PlayerImg = LoadImage ("Images/Plane.bmp")Global EnemyImg = LoadImage ("Images/Enemy.bmp")Global ExplosionImg = LoadAnimImage("Images/Explosion.bmp",32,32,0,6)Global ShipImg = LoadImage ("Images/Ship.bmp")Global CarrierImg = LoadImage ("Images/Carrier.bmp")Global ShadowImg = LoadImage ("Images/Shadow.bmp")Global WaterTile = LoadImage("Images/Water.bmp")Global FuelWord = LoadImage ("Images/Fuel.bmp")Global AirspeedWord = LoadImage ("Images/Airspeed.bmp")Global SpeedWord = LoadImage ("Images/KPH.bmp")Global AltitudeWord = LoadImage ("Images/Altitude.bmp")Global HeightWord = LoadImage ("Images/Ft.bmp")Global CloudI = LoadImage ("Images/2x2 Cloud.bmp")Global CloudII = LoadImage ("Images/3x3 Cloud.bmp")Global CloudIII = LoadImage ("Images/4x4 Cloud.bmp")Global ArrowImg = LoadImage ("Images/Arrow.bmp")Global EnemyArrowImg = LoadImage ("Images/EnemyArrow.bmp")Global AllyArrowImg = LoadImage ("Images/AllyArrow.bmp")Global EnemyCarrierArrowImg = LoadImage ("Images/EnemyCarrierArrow.bmp")Global AllyCarrierArrowImg = LoadImage ("Images/AllyCarrierArrow.bmp")Global HUDImg = LoadImage ("Images/HUD.bmp")Global HUDPlaneImg = LoadImage ("Images/HUDPlane.bmp")Global PlayerDamageImg = LoadAnimImage ("Images/Damage.bmp",32,32,0,6)Global BulletImg = LoadImage("Images/Bullet.bmp")Global Number = LoadAnimImage ("Images/Numbers.bmp",10,13,0,10)Global FuelBarHolderImg = LoadImage("Images/FuelBar.bmp")Global FuelBarImg = LoadImage("Images/FuelRemaining.bmp")Global Propellor = LoadSound("Sound/Prop.wav")Global PlayerShellSound = LoadSound("Sound/Shot.wav")Global EnemyShellSound = LoadSound("Sound/Shot.wav")Global ExplosionSound = LoadSound("Sound/Explosion.wav")MaskImage ShellExplosion,0,67,171MaskImage LandImg,0,67,171MaskImage PlayerImg,0,67,171MaskImage EnemyImg,0,67,171MaskImage ShipImg,0,67,171MaskImage CarrierImg,0,67,171MaskImage ExplosionImg,0,67,171MaskImage ShadowImg,0,67,171MaskImage CloudI,0,67,171MaskImage CloudII,0,67,171MaskImage CloudIII,0,67,171MaskImage ArrowImg,0,67,171MaskImage EnemyArrowImg,0,67,171MaskImage AllyArrowImg,0,67,171MaskImage EnemyCarrierArrowImg,0,67,171MaskImage AllyCarrierArrowImg,0,67,171MaskImage HUDImg,0,67,171MaskImage HUDPlaneImg,0,67,171MaskImage PlayerDamageImg,0,67,171MaskImage BulletImg,0,67,171ResizeImage ShellExplosion,8 * GfxW / 1024,8 * GfxH / 768ResizeImage LandImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage PlayerImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage EnemyImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage ShipImg,32 * GfxW / 1024,192 * GfxH / 768ResizeImage CarrierImg,64 * GfxW / 1024,192 * GfxH / 768ResizeImage ExplosionImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage ShadowImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage CloudI,64 * GfxW / 1024,64 * GfxH / 768ResizeImage CloudII,96 * GfxW / 1024,96 * GfxH / 768ResizeImage CloudIII,128 * GfxW / 1024,128 * GfxH / 768ResizeImage ArrowImg,7 * GfxW / 1024,12 * GfxH / 768ResizeImage EnemyArrowImg,7 * GfxW / 1024,12 * GfxH / 768ResizeImage AllyArrowImg,7 * GfxW / 1024,12 * GfxH / 768ResizeImage EnemyCarrierArrowImg,7 * GfxW / 1024,12 * GfxH / 768ResizeImage AllyCarrierArrowImg,7 * GfxW / 1024,12 * GfxH / 768ResizeImage HUDImg,102 * GfxW / 1024,102 * GfxH / 768ResizeImage HUDPlaneImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage PlayerDamageImg,32 * GfxW / 1024,32 * GfxH / 768ResizeImage BulletImg,3 * GfxW / 1024,3 * GfxH / 768SoundVolume Propellor,0.5SoundVolume PlayerShellSound,0SoundVolume EnemyShellSound,0SoundVolume ExplosionSound,1Dim PlayerAngle(Rotations)PlayerRotate(Rotations)Dim EnemyAngle(Rotations)EnemyRotate(Rotations);Dim TurretAngle(Rotations);TurretRotate(Rotations)Dim ShadowAngle(Rotations)ShadowRotate(Rotations)Dim HUDPlaneAngle(Rotations)HUDPlaneRotate(Rotations)InitiateGame()Font = LoadFont("Arial",12 * GfxW / 640,0,0,0)SetFont FontWhile Not KeyDown(88)ClsUpdateBackground()UpdateShadows()UpdateCarriers()UpdateBullets()UpdateExplosions()UpdateEnemys()UpdatePlayer()UpdateHUD()UpdateClouds()UpdateStats()UpdateCollisions()Blah()FlipWendEnd.ExitGameEndFunction UpdatePlayer()For Player.Player = Each PlayerIf KeyDown(203) Then Player\A = Player\A - 1If KeyDown(205) Then Player\A = Player\A + 1If Player\A >= Rotations Then Player\A = 0If Player\A < 0 Then Player\A = Rotations - 1If KeyDown(200)Player\Z = Player\Z + 0.11ElsePlayer\Z = Player\Z - 0.11EndIfIf KeyDown(208)Player\Z = Player\Z - 0.5EndIfIf Player\Z < 2.5 Then Player\Z = 2.5If Player\Z > 7.5 Then Player\Z = 7.5Player\X = Player\X + Player\Z * Sin(Player\A * 360 / Rotations) * GfxW / 1024Player\Y = Player\Y - Player\Z * Cos(Player\A * 360 / Rotations) * GfxH / 768Player\F = Player\F - (Player\Z/750)SoundPitch Propellor,1000 * Player\Z + 1PlaySound PropellorDrawImage PlayerAngle(Player\A),GfxW / 2,GfxH / 2If KeyHit(57)Bullet.Bullet = New BulletBullet\A = Player\A : Bullet\S = 1Bullet\X = Player\X + GfxW / 2 : Bullet\Y = Player\Y + GfxH / 2EndIfNextEnd FunctionFunction UpdateEnemys()For Enemy.Enemy = Each EnemyFor Player.Player = Each PlayerDfX# = (Enemy\X - Player\X) - GfxW / 2 : DfY# = (Enemy\Y - Player\Y) - GfxH / 2Angle# = ATan2(DfX,-DfY) + 90NextIf Enemy\A < (Angle + 90)/4 Then Enemy\A = Enemy\A + 1If Enemy\A > (Angle + 90)/4 Then Enemy\A = Enemy\A - 1If Enemy\A >= Rotations Then Enemy\A = 0If Enemy\A < 0 Then Enemy\A = Rotations - 1If Enemy\Z < 2 Then Enemy\Z = 2If Enemy\Z > 5 Then Enemy\Z = 5Enemy\X = Enemy\X + Enemy\Z * Sin(Enemy\A * 360 / Rotations) * GfxW / 1024Enemy\Y = Enemy\Y - Enemy\Z * Cos(Enemy\A * 360 / Rotations) * GfxH / 768If MilliSecs() >= Enemy\R + 250Enemy\R = MilliSecs()Bullet.Bullet = New BulletBullet\A = Enemy\A : Bullet\S = 2 : Bullet\X = Enemy\X : Bullet\Y = Enemy\YFor Player.Player = Each PlayerNextEndIfFor Player.Player = Each PlayerDrawImage EnemyAngle(Enemy\A),Enemy\X - Player\X,Enemy\Y - Player\YNextNextEnd FunctionFunction UpdateBullets()For Bullet.Bullet = Each BulletBullet\X = Bullet\X + 10 * Sin(Bullet\A * 360 / Rotations) * GfxW / 1024Bullet\Y = Bullet\Y - 10 * Cos(Bullet\A * 360 / Rotations) * GfxH / 768Bullet\L = Bullet\L + 1For Player.Player = Each PlayerDrawImage BulletImg,Bullet\X - Player\X,Bullet\Y - Player\YIf Bullet\L >= 50DrawImage ShellExplosion,Bullet\X - Player\X,Bullet\Y - Player\YDfX# = (GfxW/2-(Bullet\X-Player\X)) : DfY# = (GfxH/2-(Bullet\Y-Player\Y))Hyp# = Sqr(DfX^2 + DfY^2) : SHyp# = Sqr((GfxW/2)^2 + (GfxH/2)^2) / 2If Not Bullet\S = 1 Then SoundVolume EnemyShellSound,1-1/(SHyp/Hyp)If Not Bullet\S = 1 Then PlaySound EnemyShellSoundIf Bullet\S = 1 Then SoundVolume PlayerShellSound,1-1/(SHyp/Hyp)If Bullet\S = 1 Then PlaySound PlayerShellSoundDelete BulletEndIfNextNextEnd FunctionFunction PlayerRotate(Degrees)For Frame = 0 To DegreesPlayerAngle(Frame) = CopyImage(PlayerImg)RotateImage PlayerAngle(Frame),Frame * 360 / DegreesNextEnd FunctionFunction EnemyRotate(Degrees)For Frame = 0 To DegreesEnemyAngle(Frame) = CopyImage(EnemyImg)RotateImage EnemyAngle(Frame),Frame * 360 / DegreesNextEnd FunctionFunction ShadowRotate(Degrees)For Frame = 0 To DegreesShadowAngle(Frame) = CopyImage(ShadowImg)RotateImage ShadowAngle(Frame),Frame * 360 / DegreesNextEnd FunctionFunction HUDPlaneRotate(Degrees)For Frame = 0 To DegreesHUDPlaneAngle(Frame) = CopyImage(HUDPlaneImg)RotateImage HUDPlaneAngle(Frame),Frame * 360 / DegreesNextEnd FunctionFunction UpdateBackground()For Player.Player = Each PlayerTileImage WaterTile,- Player\X,- Player\Y,0NextEnd FunctionFunction UpdateShadows()For Player.Player = Each PlayerFor Enemy.Enemy = Each EnemyDrawImage ShadowAngle(Enemy\A),Enemy\X+50*GfxW/1024-Player\X,Enemy\Y+75*GfxH/768-Player\YNextDrawImage ShadowAngle(Player\A),GfxW/2+50*GfxW/1024,GfxH/2+75*GfxH/768NextEnd FunctionFunction UpdateStats()For Player.Player = Each PlayerDrawImage FuelWord,25,10WriteNumber(Int(Player\F),55,10)DrawImage FuelBarHolderImg,105,27DrawImageRect FuelBarImg,105,27,0,0,2 * Player\F,10WriteNumber(Int(Player\Z*100),110,43) : DrawImage SpeedWord,155,43DrawImage AirspeedWord,50,43;WriteNumber(Player\L,110,60) : DrawImage HeightWord,155,60;DrawImage AltitudeWord,50,60;Color 100,75,50 : Rect 5,22,2 * Player\F,10NextEnd FunctionFunction UpdateHUD()For Player.Player = Each PlayerDrawImage HUDImg,GfxW-61*GfxW/1024,61*GfxH/768DrawImage HUDPlaneAngle(Player\A),GfxW-61*GfxW/1024,61*GfxH/768DrawImage PlayerDamageImg,GfxW-134*GfxW/1024,36*GfxH/768,Int(5 - (Player\L/2))Color 100,100,100Rect GfxW-161*GfxW/1024,10*GfxH/768,52*GfxW/1024,7*GfxH/768,0Color 50,50,50Rect GfxW-160*GfxW/1024,11*GfxH/768,50*GfxW/1024,5*GfxH/768Color 255-Player\L*25,Player\L*25,0Rect GfxW-160*GfxW/1024,11*GfxH/768,Player\L*5*GfxW/1024,5*GfxH/768For Enemy.Enemy = Each EnemyDfX# = GfxW / 2 - (Enemy\X - Player\X) : DfY# = GfxH / 2 - (Enemy\Y - Player\Y)Angle# = ATan2(DfX,-DfY) + 90Pointer = CopyImage(EnemyArrowImg) : RotateImage Pointer,Angle + 90DrawImage Pointer,GfxW-(61-Cos(Angle)*50)*GfxW/1024,(61+Sin(Angle)*50)*GfxH/768NextFor Carrier.Carrier = Each CarrierDfX# = GfxW / 2 - (Carrier\X - Player\X) : DfY# = GfxH / 2 - (Carrier\Y - Player\Y)Angle# = ATan2(DfX,-DfY) + 90If Not Carrier\S = 1 Then Pointer = CopyImage(EnemyCarrierArrowImg) If Carrier\S = 1 Then Pointer = CopyImage(AllyCarrierArrowImg) RotateImage Pointer,Angle + 90DrawImage Pointer,GfxW-(61-Cos(Angle)*50)*GfxW/1024,(61+Sin(Angle)*50)*GfxH/768NextNextEnd FunctionFunction WriteNumber(Num#,X,Y)NumStr$ = Num#For I = 0 To Len(NumStr) - 8DrawImage Number,X+10*I,Y,Int(Mid(NumStr,I + 1,1))NextEnd FunctionFunction UpdateClouds()For Cloud.Cloud = Each CloudFor Player.Player = Each PlayerIf Cloud\S = 2 Then DrawImage CloudI,Cloud\X - Player\X,Cloud\Y - Player\YIf Cloud\S = 3 Then DrawImage CloudII,Cloud\X - Player\X,Cloud\Y - Player\YIf Cloud\S = 4 Then DrawImage CloudIII,Cloud\X - Player\X,Cloud\Y - Player\YNextNextEnd FunctionFunction UpdateCollisions()For Player.Player = Each PlayerFor Bullet.Bullet = Each BulletIf Not Bullet\S = 1If ImagesCollide(PlayerAngle(Player\A),GfxW/2,GfxH/2,0,BulletImg,Bullet\X-Player\X,Bullet\Y-Player\Y,0)Delete Bullet : Player\L = Player\L - 1 : Goto NextBulletEndIfEndIfIf Not Bullet\S = 2For Enemy.Enemy = Each Enemy.EnemyIf ImagesCollide(BulletImg,Bullet\X-Player\X,Bullet\Y-Player\Y,0,EnemyAngle(Enemy\A),Enemy\X-Player\X,Enemy\Y-Player\Y,0)Delete Bullet : CreateExplosion(Enemy\X,Enemy\Y) : Delete Enemy : Goto NextBulletEndIfNextEndIf.NextBulletNextNextEnd FunctionFunction Blah()For Player.Player = Each PlayerIf Player\L < 0 Then InitiateGame()NextEnd FunctionFunction CreateExplosion(X,Y)Explosion.Explosion = New ExplosionExplosion\X = X : Explosion\Y = YExplosion\F = 0 : PlaySound ExplosionSound End FunctionFunction UpdateExplosions()For Explosion.Explosion = Each ExplosionExplosion\F = Explosion\F + 1If Explosion\F > 5 Then Delete Explosion : Goto NextExplosionFor Player.Player = Each PlayerDrawImage ExplosionImg,Explosion\X - Player\X,Explosion\Y - Player\Y,Explosion\FNext.NextExplosionNextEnd FunctionFunction UpdateCarriers()For Carrier.Carrier = Each CarrierIf MilliSecs() >= Carrier\R + 5000 And Carrier\P > 0Carrier\R = MilliSecs() : Carrier\P = Carrier\P - 1Enemy.Enemy = New EnemyEnemy\X = Carrier\X : Enemy\Y = Carrier\YEndIfFor Player.Player = Each PlayerDrawImage CarrierImg,Carrier\X - Player\X,Carrier\Y - Player\YWriteNumber(Carrier\P,Carrier\X - Player\X,Carrier\Y - Player\Y)NextNextEnd FunctionFunction InitiateGame()For Player.Player = Each PlayerDelete PlayerNextFor Enemy.Enemy = Each EnemyDelete EnemyNextFor Bullet.Bullet = Each BulletDelete BulletNextFor Cloud.Cloud = Each CloudDelete CloudNextFor Carrier.Carrier = Each CarrierDelete CarrierNextPlayer.Player = New PlayerPlayer\F = 100 : Player\L = 10Carrier.Carrier = New CarrierCarrier\X = Rnd(-32*32,32*32)*GfxW/1024 : Carrier\Y = Rnd(-32*32,32*32)*GfxH/768Carrier\S = 1Carrier.Carrier = New CarrierCarrier\X = Rnd(-32*32,32*32)*GfxW/1024 : Carrier\Y = Rnd(-32*32,32*32)*GfxH/768Carrier\S = 2 : Carrier\P = 10For I = 1 To 10Cloud.Cloud = New CloudCloud\X = Rnd(-32*32,32*32)*GfxW/1024 : Cloud\Y = Rnd(-32*32,32*32)*GfxH/768 : Cloud\S = Rnd(2,4)NextEnd Function [Edited by - Ending_Credits on June 2, 2009 11:04:36 AM]; In fact BlitzMax is actually an excellent language for games development. Its cross platform (Mac, Linux and Windows) and the learning curve is not nearly as steep as it is for others.I know a variety of languages including C#, Java, VB, etc but I still use BlitzMax for games programming. I just got BlitzMax after using Blitz3D for several years. Max has everything you need for games development and a community of contributors that help along the way. It has advanced types (similar to classes) with polymorphism and inheritance allowing for an Object Oriented approach, or you can stick to the procedural paradigm with the advanced data types.Cheers ; First you should ask opinions and such from people and then buy something.Not buy some compiler and then ask if it's good.You will waste your money doing so. ;Quote:cin isn't part of the C++ language, it's part of the iostream library.cin is part of the standard library, which is part of the language as defined by the language's ISO specification.Quote:One example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle.You believe this, I suspect, because you believe that C++ is somehow indicative of "the way things work." That's not really the case at all; cin is hardly a "core programming technique." C++ provides you a bunch of abstractions just like any other language will -- the same functionality will be achieved in different ways in different languages and different APIs. Try not to approach learning a new language too much from the perspective of the syntax and specifics of another language you know.Quote:I have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics.There is absolutely nothing wrong or shameful or 'newbie' about using something like BlitzMax. Especially since you've purchased it, you should give yourself some time to use it. What is important to learn as a programmer is how to think like one, and how to think in general, and you can do that with any language and any development environment. Even Game Maker. Quote:Would I be better off getting my feet wet with something like Python->pygame? How does pygame present itself to someone who would be new to programming? Or maybe something like C-Allegro?Python would be a great choice (except, again, you already spent money on this Blitz thing, so give it some time). C would be a less-than-great choice.
id Software bought by Zenimax/Bethesda
GDNet Lounge;Community
No, seriously.It sounds like id is basically making a move to become a publisher here, in order to more closely control the IPs that they license. I would've expected it to happen with Activision or maybe EA, but I suspect Zenimax is a lot smaller -- and healthier -- and will allow them to exert much more control. (And I suppose it helps that the two don't develop games that will compete directly.)By the way, id Software was one of the big remaining indie studios. That's another one down.
Certainly wasn't expecting that when I got up this morning, although by the looks of the article nothing much is going to change. ; I'm not really sure you could call this "another one down". id has gotten too big for its own britches over the years (not really a bad thing), so they needed to do something to better manage their resources. Seems like a pretty smart move. ; Although I have nothing to back this up, the idea of something called "Zenimax Media Group" owning id software gives me bad vibes. ; Woot. Maybe they'll share technology. ;Quote:Original post by greksterCertainly wasn't expecting that when I got up this morning, although by the looks of the article nothing much is going to change.Any time this happens, I get scared. They say not much is going to change, but I think of all the other independent companies who stated the same exact thing only to become a shell of what they once were. ; Maybe I'm just completely ignorant of how all of this works, but as big as id is couldn't they just become a publisher? Just like Nintendo and EA did? ;Quote:Original post by OrangyTangAlthough I have nothing to back this up, the idea of something called "Zenimax Media Group" owning id software gives me bad vibes.Don't forget that they're also the owners of Bethesda Softworks, and those guys have certainly kept me happy over the years :) ; Why hello Gamedev. It's been a while.Anyway, I see that as a good thing. Has iD been relevent since... Doom 3 ? I mean, their main asset is/was John Carmack, but these days, he seems much more interested in spaceships than video games. The design of their games has, IMHO, always been lackluster, which wasn't a problem back in the days where they pretty much invented the FPS genre and WERE the market. Now that competition has ramped up, it seems to me like they have lost their edge. ; I guess it's hard to find good game programmers in Texas since I was just looking at their job openings the other day and was suprised at how many openings they had!I also read John Carmack's post on porting Wolfenstein to the iphone and it also sounded that he wasn't too happy about the way EA was doing it and just did it himself so I don't think he's spending all him time building spaceships LOL!But yeah I hope Carmack is still able to stand up against Zenimax/Bethesda like he did against EA if he doesn't agree with them.
OSS shader generator?
Graphics and GPU Programming;Programming
I was wondering if somebody knows about a library that can generate hardware shader code. I know blender does it internally, at least it was a summer of code, but I was looking for something generic.As an aside, does CUDA support linear/anisothropic filtering? I remember it didn't, but that's a while ago.
What do you mean "hardware shader code"? Are we talking HLSL/GLSL, or actually the driver layer opcodes? Also, generate it from what exactly? ; HLSL/CG/GLSL, I'm not being picky. Where it's gets the abstract syntax tree is also not important for me. I'm more wondering what is out there, or if I should roll out my own program generator. I want to use it for run-time defined procedural textures/shaders.
Big Indie Video Game Development Looking for Programmer and Writer !!
Old Archive;Archive
Action and Open World Video Game Company (45 Developers) In Need of more Concept Artists, Logo Designers(graphic designers), programmers, writer and 3D Modelers.Are you an artist (2D or 3D) who would love to see your work on conventions and PC screens around the world? Do you love building worlds or designing characters and then seeing them come to life? We would need Concept Artst which can draw realistic characters with an kinda comic style or GTA style ... If those thoughts appeal to the artist within you, we at MuellnerProductions (current name) would love to have you on our team. Read on to find out how you can be a part of the "next big thing" in gaming.Who we are:The studio was founded by a tight-knit group of friends, with the express purpose of creating fun, innovative and solid interactive experiences, with an emphasis on immersion and storytelling. Muellner Production (current name) is located in Austria, Vienna. You don't have to relocate !!!And we the 40 developers don't pay each other but we are currently working on the Iphone game version so money isn't far.Kelvin Law - Lead Character ArtistWhat we are doing:Here's a quick overview, basically our general vision, of our current project:About The GAMEIt's a huge and emotional story. Expect a plenty of cruising around the 5 huge cities and expect a lot of shooting with the 24 wicked, customizable weapons in RL:TG. The genre is action and open-world. The core gameplay consists of elements of a third-person shooter and a driving game, affording the player a large, open environment in which to move around. On foot, the player's character is capable of walking, running, swimming, climbing and jumping, as well as using weapons and basic hand-to-hand combat. Players can steal and drive a variety of vehicles, including automobiles, boats, helicopters, motorcycles, jets and tanks. This video game offers a lot to do in the 5 cities with the sandbox-style.If you need infos about the story please dont hesitate we will tell you about the story !!!! It's just kinda dangerous publishing the story to non developers...How you can help:Right now, we're mostly trying to flesh out the design of The GAME, and were looking for aspiring artists or designers to help us pin down the visual design. While we have a wealth of design descriptions and supplementary material showcasing the look and feel we are going for, we are in dire need of an artist(s) that can help us bring those designs to life. There is room for various types of artists, whether you’re interested in character design, world/level design, fashion, User Interface / HUD design, or quite honestly anything else you can think of that involves artwork.If any of this sounds remotely interesting, please contact us using the following:Current Website:You can email us at:When you contact us we can give a bit more information about The GAME and we can show you 3D Models and current concepts and further discuss the ways you can help us make this dream a reality.[Edited by - nsmadsen on June 25, 2009 10:09:57 AM]
still looking for developers !!! ;Quote:Bumping:As a general rule, bumping is not allowed in the Help Wanted forum. There are however, certain conditions under which it will be allowed: * If after 2 days your thread has received no replies. In this case, you may bump the thread once, but you should first make some changes to the original post - try to provide updates and/or additional information. You may repeat this a few (not more than three or four) times, after which you should wait a couple of weeks. * If you are adding additional content, you may do so by editing the original post. * You may at any time post to say that all positions have been filled. * You may at any time respond to questions posted in your thread.You should also check out the posting template which is mandatory. You have some sections filled out but are missing others. ; To clarify - you already have 45 developers? ; No template. Feel free to post again once you follow the template, which you can find in the stickies section of this forum. Thanks!Nathan
2D artist wanted
Old Archive;Archive
I'm developing a Flash RPG for fun (that means not for money) that is designed to be very large. I have already programmed the engine to be able to scroll the entire world seamlessly as well as basic AI functionality, attacks/spells, triggering different running animations depending on what direction you're going, etc. Having to do all of the artwork on top of game design and programming is too much for me to do. This would be a nice project to put under your belt as an artist because it would be a completed, polished piece of work that will most likely be viewed by a lot of people online.You can email examples of your work to infernosnow(a-t)gmail(d-o-t)com and I will explain to you the style of art I'm looking for.
Weird Bug (feels like code is not being executed))
For Beginners
Hi Guys, hopefully you can help.I have been working with PhysX and Directx.After initalising PhysX i get an object's PhysX matrix, convert it to directX, manipulate it and then apply it to the PhysX object, to rotate and translate, i.e. set a starting point.I do it like this: D3DXMATRIX matT;NxMat34 Tmat;trike->getGlobalPose().getColumnMajor44(matT);matT = Rotate(0,90,0)*Translate(0,0,-10)*matT;Tmat.setColumnMajor44(matT);trike->setGlobalPose(Tmat);This code is at the end of this function:void InitNx(){// Initialize Camera Parameters//gCameraAspectRatio= 1.0f;//gCameraPos= NxVec3(0, 5, -15);//gCameraForward= NxVec3(0,0,1);//gCameraRight= NxVec3(-1,0,0);// Create a memory allocator if (!gAllocator){gAllocator = new UserAllocator;assert(gAllocator);}// Create the physics SDK gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, gAllocator);if (gPhysicsSDK) {// connect to PVD, then you can see the physics objects inside PVD (you should start PVD before your application)gPhysicsSDK->getFoundationSDK().getRemoteDebugger()->connect("localhost", 5425);} if(!gPhysicsSDK){MessageBox(NULL, L"PhysX Could Not be Initalised. This could be due to it not being installed", L"PhysX Error", MB_OK);ShellExecute(NULL, L"open", L"http://www.nvidia.com/object/physx_system_software.html",NULL, NULL, SW_SHOWNORMAL);}// Set the physics parametersgPhysicsSDK->setParameter(NX_SKIN_WIDTH, 0.01); NxSceneDesc sceneDesc; sceneDesc.gravity= gDefaultGravity; sceneDesc.simType= NX_SIMULATION_SW; gScene = gPhysicsSDK->createScene(sceneDesc); // Create the default material gSelectedActor = trike;NxMaterial* defaultMaterial = gScene->getMaterialFromIndex(0);defaultMaterial->setRestitution(0.5); defaultMaterial->setStaticFriction(0.5); defaultMaterial->setDynamicFriction(0.5); // Create the objects in the scene///////////////////////^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^£££££££££££££££££££££££££££££££//////////////////////////////////////////////////////////////////////////////////////gTerrain = GenerateTriangleMesh(room.MMesh(), "room.bin");// Reset wheel materialwsm = NULL;// Create the trike actortrike = CreateTrike(NxVec3(-20,0,0));trike->wakeUp(1e30);AddUserDataToActors(gScene);// Get the current timedeltatime = UpdateTime();// Start the first frame of the simulationif (gScene) {StartPhysics();}D3DXMATRIX matT;NxMat34 Tmat;//trike->getGlobalPose().getColumnMajor44(tempmatModel);trike->getGlobalPose().getColumnMajor44(matT);matT = Rotate(0,90,0)*Translate(0,0,-10)*matT;Tmat.setColumnMajor44(matT);trike->setGlobalPose(Tmat);}When running the program, the object is manipulated prefectly about 5/6 of the time. But occasionally, the matrix is not applied. I really can't work out why!Why will it work sometimes and not all or nothing. Computers should do the same thing every time.My first thought was that it might be something to do with the clean up of the program, but i don't know how i'm supposed to clean up PhysX and Directx classes, i thought they were done automatically.Just so you know i quit the program using the Escape key and the WinMain function i use is below:int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ HWND hWnd; WNDCLASSEX wc; ZeroMemory(&wc, sizeof(WNDCLASSEX)); wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WindowProc; wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpszClassName = L"DirectxGameEngine"; RegisterClassEx(&wc); hWnd = CreateWindowEx(NULL, L"DirectxGameEngine", L"DirectxGameEngine", WS_OVERLAPPEDWINDOW, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); // set up and initialize Direct3D initD3D(hWnd);InitNx();//Where the function is called from in WinMain. // enter the main loop: MSG msg; while(TRUE) {++fps; DWORD starting_point = GetTickCount(); if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } render_frame(); // check the 'escape' key if(KEY_DOWN(VK_ESCAPE)) PostMessage(hWnd, WM_DESTROY, 0, 0); while ((GetTickCount() - starting_point) < 25); } // clean up DirectX and COMReleaseNx(); cleanD3D(); return msg.wParam;}Any and all commments Welcome (i'm hoping this is just a noob mistake!)Any if you need anymore information just let me know!Thanks in advanceJamesCobras[Edited by - JamesCobras on June 25, 2009 8:48:28 AM]
Have you stepped through it in the debugger? ;Quote:Original post by MikeTacularHave you stepped through it in the debugger?Yeah i have, but after i posted the original post:I watch the matices, in the bugged game and when it is normal.The matrices are the same if bugged and if not bugged!Hmm.... now i'm really stumped....Checked the set up matrices (the directx one and PhysX one), they are the same..Will now set through and see if other matrices mess up. But why would this be an intermitent problem...The two states are always the same, i.e. when bugged the objects are always in the one place, when not bugged objects are in a another place place. So there is not any weird randomisation/heap over run or any really weird behavior, like random values.grr................Well the bug is not in the intialisation bit but else where. This problem began to occur after the inisalisation though.JamesCobras ; UPDATE:Found exactly where the issue lies.Its a problem with PhysXits at this function D3DXMATRIX matT;NxMat34 Tmat;trike->getGlobalPose().getColumnMajor44(matT);matT = Rotate(0,90,0)*Translate(0,0,-10)*matT;Tmat.setColumnMajor44(matT);//here matT = Tmat in debugger, good so far!trike->setGlobalPose(Tmat);//so the matrix goes in right trike->getGlobalPose().getColumnMajor44(testmatrix);// but when you get it again, guess what testmatrix != Tmat or matTweird, eh? I can't do much about that! That is really bad eh?Here is the debug, just incase you want to see it.This is all gathered from a break point after the above code.matT{...}D3DXMATRIX_D3DMATRIX{_11=-4.3711388e-008 _12=0.00000000 _13=-1.0000000 ...}_D3DMATRIX_11-4.3711388e-008float_120.00000000float_13-1.0000000float_140.00000000float_210.00000000float_221.0000000float_230.00000000float_240.00000000float_311.0000000float_320.00000000float_33-4.3711388e-008float_340.00000000float_41-20.000000float_421.0000000float_43-10.000000float_441.0000000floatm0x0042c5c0 struct D3DXMATRIX matTfloat [4][4]Tmat{M={...} t={...} }NxMat34M{data={...} }NxMat33data{s={...} m=0x0042c768 }Nx9Reals{_11=-4.3711388e-008 _12=0.00000000 _13=1.0000000 ...}Nx9Real::S_11-4.3711388e-008float_120.00000000float_131.0000000float_210.00000000float_221.0000000float_230.00000000float_31-1.0000000float_320.00000000float_33-4.3711388e-008floatm0x0042c768 class NxMat34 Tmatfloat [3][3]t{x=-20.000000 y=1.0000000 z=-10.000000 }NxVec3x-20.000000floaty1.0000000floatz-10.000000floattestmatrix{...}D3DXMATRIX_D3DMATRIX{_11=1.0000000 _12=0.00000000 _13=0.00000000 ...}_D3DMATRIX_111.0000000float_120.00000000float_130.00000000float_140.00000000float_210.00000000float_221.0000000float_230.00000000float_240.00000000float_310.00000000float_320.00000000float_331.0000000float_340.00000000float_41-20.000000float_421.0000000float_430.00000000float //note no -10 here!!!!!_441.0000000floatm0x0042c618 struct D3DXMATRIX testmatrixfloat [4][4]Any ideas which might help me fix this?JamesCobras
Picking - Point on near plane - Why?
Graphics and GPU Programming;Programming
Hi,I've just touched up my picking code, it was working but not not accurately which I only just noticed. Anyway, what I was doing was treating the position of the camera as the origin of the ray and the direction as (camera - mouse point on the far plane). Changing the origin to the mouse point on the near plane obviously works and using the camera doesn't, my question is why?I would have imagined that as the near plane distance approaches 0 then any points on it approach the camera position, and the only reason we don't set the near plane to be 0 is due to the nonlinearity of the z-buffer.In any case, it works now, im just curious.
The camera position is all the same no matter which pixel on the screen your mouse is over, hence a ray constructed from the camera position is all the same no matter which pixel you are clicking on with the mouse. So you really need to use the mouse position because each pixel on the screen has its own ray with its own direction (for perspetive projection at least, for orthogonal the direction would be the same but the position would change as well).The reason is that the camera does not only see a single line but a whole volume that consists of an infinite number of different rays. Of course you are right that the camera position is just a single position but the issue is that you see an image that is projected not onto this singularity of the camera position but onto a projection plane which is an area. Hence the number of rays equals the number of points making up the projection area. In real world this is always an infinite number but in terms of screen resolutions its the pixel width*height of your screen. ; Perhaps a fine detail, but is the user selecting or shooting? :)If you're selecting, you usually want to do intersection queries against the line segment mousePosAtNearPlane -> mousePosAtFarPlane (not a ray). If you do the queries against the line segment cameraPos -> mousePosAtFarPlane, you risk picking on objects that are between the camera and the near plane, which are effectively too close to the camera and were culled away in the rendering process. Similarly, you want to avoid querying using a ray, since that extends beyond the far plane and you'd possibly be picking hidden objects as well. Of course if in your setting you know that there won't be any false picks at z distances [0, nearPlaneDist] and [farPlaneDist, +inf] from the camera, then it's not much of a change. Using a finite line segment as opposed to an infinitely long ray is both faster (you won't extend to search through you whole spatial acceleration structure in one direction in the case of a negative result on the query) and more correct (can't pick hidden objects). If you're shooting, it might be more justified to query using a ray that is positioned at cameraPos, and which extends infinitely into the screen. It would also be more accurate to do your queries using the camera position and mouse position from the *previous* frame, which is most probably (modulo triplebuffering) what the user saw when he clicked on the screen. In a standard setting, that's not necessarily much of a difference, but when you have those 13-year old kids that are sending your support people flame e-mails of how they know they really did hit the opponent in the head in your latest FPS.. Sigh..
Is there any way that TortoiseSVN compress files when using an online repository?
GDNet Lounge;Community
Hi friends!Is there any way that TortoiseSVN compress files when using an online repository?Is that possible?Thanks in advance.
I am pretty sure it does because when i download my entire project, it takes up a lot more room on my machine than it does in the actual repository. The only way I can see that as being possible is through compression. Also, I am pretty sure the difference between revisions is done in diff files instead of being an entire separate copy of the file. ;Quote:Original post by landagenI am pretty sure it does because when i download my entire project, it takes up a lot more room on my machine than it does in the actual repository. The only way I can see that as being possible is through compression. Also, I am pretty sure the difference between revisions is done in diff files instead of being an entire separate copy of the file.Do you mean TortoiseSVN already has implemented (and uses automatically) that feature? ; Sorry, I misread your question. I do not know specifically for Tortoise SVN. If you need to compress the repository you could just tell windows to compress the folder that the repository is in. ; Actually, Tortoise doesn't compress your repository, because it would make your entire repository completely useless to other clients. Tortoise doesn't implement this feature and I doubt it ever will, because many of the commands issues by Tortoise are executed on the server, such as diffs, blames, etc.And by compressing your data client side, you lose all those abilities, which makes a repository quite useless. I'm not sure if it's possible enable compression server-side, but that probably requires you to have (shell)-access to the server. But keep in mind that compression will significantly impact server performance, because for all the action you'll run on your repos, SVN will have to uncompress the files, and in later stages re-compress them.And about the working copy size being much larger than the server-side HEAD version: All SVN clients keep a lot of additional files in .svn folders for housekeeping purposes. One of this is that all the files are doubled: You have your working copy ones, and in the .svn folders are a copy of the files so the 'check for modifications' can be done locally by comparing the files with the housekeeping files. This keeps server load low and response times fast.Toolmaker ; I was under the impression that Subversion already uses zlib for compressing diffs. ; Thanks for replies, but I think I did a wrong question.My question was if TortoiseSVN compress data that is going to be sent over Internet. I don't care how is stored on hard disk, just on the net, I ask this because I'm using an online repository, and sometimes it takes a while to upload large files.Do you understand me now? (obviusly English is not my main language, and sometimes I have problems to express myself) Thanks! ; The internet connection itself generally takes care of compressing things in transit. Don't believe me? Make a huge text file with the same word over and over, then try uploading it to Rapidshare or something.
OpenGL ES: Render portion of a texture
Graphics and GPU Programming;Programming
Im just wondering how can you render a portion of a texture, basically for 2D animation, so render start at 50,50 to 120,120. Ive tried using glTexSubImage2D but it doesn't seem to work. I can't find anything mentioning how to do this.
Yes, in fact, I'm pretty sure you can. Just manipulate the UV coordinates. The range, for UV coordinates, is [0,1], therefore you must use the dimensions of your texture and derive the size of a pixel by doing: 1.0 / DimX and 1.0 / DimY. Those are the respective offsets that you will need to use if you plan to move to any given (X,Y) in pixel space. ; Yeh im trying to hardcode some values now to do that, getting some weird results lol ; Fixed it now, thanks.
Keeping spaceships apart
For Beginners
I'm making a space based RTS game (2D). There are bunch of space ships that the player controls, e.g. he selects them and orders to move to some new location.Now, when the spaceships arrive at the new location I want to put some space between them.It's OK that they overlap each other while traveling, but not when stopped.What's a simple way to accomplish this?(I have no physics system.)
Several options. When you group a set of units, assign one as a lead, and sort the rest. Then develop a method of simple formations.+++1+++++2+3+++4+5+6+7+8+9+10Or something similar.That, or pick a leader/head of the 'flock' and write a sorting method that will let the other ships find their own open slots around the leader. Each would find the closest open space near the leader. ;Quote:Original post by TalrothSeveral options. When you group a set of units, assign one as a lead, and sort the rest. Then develop a method of simple formations.+++1+++++2+3+++4+5+6+7+8+9+10Or something similar.That, or pick a leader/head of the 'flock' and write a sorting method that will let the other ships find their own open slots around the leader. Each would find the closest open space near the leader.I'm not really looking for flocking.All spaceships move from A to B, in euclidean space, linearly, equally.Once a spaceship arrives at B, stops, then the game should ensure that overlapping spaceships are somehow kept apart. ;Quote:Original post by appelOnce a spaceship arrives at B, stops, then the game should ensure that overlapping spaceships are somehow kept apart.That's exactly what Talroth solved for you. Have all your ships move linearly and equally from A to B, then have them stop. Assign all the ships an ID, sort based on the ID, and then use the ID to implement whatever formation you want.
giving a coordinate of an object to glsl
For Beginners
Hy I created a scene: it is a simple box with a sphere inside. I'm using shaders to texture the sphere (it is reflecting the box). Now i need to know in the shader where the center of the box is located. In my application, the center of the box is the origin of the coordinate system.Should i pass the center of the box by uniform variables?Is there a buildt in variable i could use? In which space will it be when it is loaded into the shader?
Hi, Try this site for great GLSL-tutorials.http://www.lighthouse3d.com/opengl/glsl/; Pass in den center as global variable (should be uniform in GLSL but I am more into HLSL). Its in exactly the same space it was in when you send it to the shader. Those global shader vaiables are not modified automatically. You get the same coordinates you filled in. Its up to you to transform the coordinates if you need to. ; "Its in exactly the same space it was in when you send it to the shader. Those global shader vaiables are not modified automatically. You get the same coordinates you filled in. Its up to you to transform the coordinates if you need to."So the question is: i have a vertex position, known to me as the built in variable gl_Vetrex. It is in object space. i can transform this gl_Vertex to Eye Space by the built in matrix gl_ModelViewMatrix. But i dont know where the origin of the object space is by default. Is this defined by the application?If i knew where the origin of the object space is, i could transform the center of my cube to the objectspace and afterwards with help of gl_ModelViewMatrix to Eye Space.... ; EitherA) Transform the vertices in the shader onlyorB) Supply the original position to the shader "A" gives the benefit of letting the GPU do all the work. simply plug in the object matrix in your shader code and let the graphicsprocessor do the work. "B" requires double work, part CPU and part GPU. ; at Rasmadrak: I dont understand what you try to explain to me. Could you try it in another way?I spoke to someone in the Company, he gave me an idea which could work:In my application the position of the cube-center is known. also the camera/eye-position is known. The eye-position is in Eye coordinates the position (0,0,0). I am going to use the eye position which is known in the vertex shader to calculate the cube-center in eye coordinate.I will try this and post whether it works or not.write me if you think you have a better idea. ;Quote:Original post by DISLBut i dont know where the origin of the object space is by default. Is this defined by the application?No, the origin is always at (0, 0, 0) and gets translated by the translational part of your MODELVIEW matrix. But I assume you are talking about the Bounding Box and its center you have for this object? If your cube is already in world space you just need to set the cube's center as uniform variable and multiply this with the gl_ModelViewMatrix. Then its in the same space as the vertices. Which again leads me to believe that the build in GLSL variables kinda ... well ... suck. If you would be required to actually send your transformation matrices to the shader as uniform variables as well (as in HLSL) you would have quite a better understanding of what you are actually doing with those shader calls. No offense against you implied just against this OpenGL mixture of fixed function pipeline calls redirecting automatically to the shader pipeline. [grin]; Im not using OpenGl. I'm using Xith3d to creating the environment. Xith3d using a Scene-graph-concept based on OenGl. I created this scene: A Box built around the origin of the scene. I positioned the camera in postion (6,0,6) and i positioned the Sphere, which is going to be textured by the shader, to (1,1,0). Then afterwards i call the shader to texture the sphere. The shader has a object space in which the gl_vertex and a eye space everithing is calculated. this is maybe more a question for xith3d community....
Hosting WPF inside D3D Application
General and Gameplay Programming;Programming
Hello,I'm wondering if it is possible to somehow host or render WPF based application or code inside D3D application. It would be great if you can point me in the right direction, or better off show the code sample. Since WPF is based on D3D, does anyone has ideas on how to access it from OpenGL?Thanks.
I can't answer your question with any certainty, but the couple of links may give you a push start in the right direction. As for accessing it in OpenGL I've found a number of links that let you embed OpenGL into a WPF application, but nothing the other way around.http://blogs.msdn.com/greg_schechter/archive/2006/05/02/588934.aspxhttp://www.vistax64.com/avalon/192-rendering-wpf-into-directx-surface-device.htmlHTH,NewBreed. ; Disregarding input focus, you could get away with taking a screenshot of the WPF window and using it as a texture in your D3D or OpenGL application. Not terribly efficient and getting input to work correctly is going to be hard, but in theory this should work.However, why don't you go the other way round, i.e. embed your D3D or OpenGL context inside a WPF window? This is definitely achievable. ; Thanks to all replied to this. What I was looking for is to create an overlay using WPF on top of D3D based application, since D3D on XP machines is not up to the job. ; You'd think that, since WPF can render via D3D, it would be doable. It's also exactly the kind of implementation detail that's probably not exposed. But if you do find something, I would be really interested to see it. ;Quote:Original post by Daniel ProtopopovThanks to all replied to this. What I was looking for is to create an overlay using WPF on top of D3D based application, since D3D on XP machines is not up to the job.Your best bet is to make a WPF application with a fullscreen background image using D3D and D3DImage from WPF. Then, you can overlay WPF controls.I must warn you that D3DImage is not very performant on XP. However, this will be the most realistic way of accomplishing your goal. I do this, and it works well. Use any other method and airspace restrictions will kill you, even if you try the overlay method.
Is the number of texture lookups limited?
Graphics and GPU Programming;Programming
Hi,my geometry shader code fails when calling texelFetch2D. There's no syntax error in the code and the texture coordinates are valid. The code reads from only 1 texture unit, but up to 12 times (with different coordinates each time) per primitive.Could this be the problem? Is the number of texture lookups limited?TiKu
Yes, it is. It depends on the Shader Model you're compiling for, and probably on the card, too. For shader model 2, you're allowed to have 32 texture accesses per pixel shader, but only to indirection level 6. So if you fetch a texel, calculate a new texcoord from it and use it to fetch another texel, that's an indirection level. These constraints are somewhat lifted in shader model 3, and are close to non-existent in shader model 4. ; Interesting. My card is a Geforce 8800 GTS. Geometry shaders are part of SM4.0 if I remember correctly, so I'm pretty sure I use shader model 4.0.I have 1 texture lookup in the fragment shader, none in the vertex shader and up to 12 in the geomtry shader. From what you've written, this shouldn't be a problem?!Maybe it's not the number of texture lookups that's too high, but the number of variables. I know that there is a limit for varying variables. Do variables defined inside a function count as varying? I have only 4 shader-wide uniform variables and 1 shader-wide varying variable, but inside the functions I declare some more variables. ; There really seems to be such a limit. I changed the shader code to heavily reuse variables and now it works.
GUIs and more than one texture.
General and Gameplay Programming;Programming
If I have declared my Vertices to cover the entire screen as follows: public VertexPositionTexture[] Vertices; public VertexDeclaration VertexDeclaration; public FullScreenVertices(GraphicsDevice graphicsDevice) { // Define Triangles clockwise (TraingleStrip Method) so they face the Camera [TL -> TR -> BL -> BR] this.Vertices = new VertexPositionTexture[4]; int i = 0; /* * (-1,1)-----------(1,1) [x]: -1 -----> 1 * || * || [y]: 1 * |(0,0)| | * || | * || | * (-1,-1)__________(1,-1) -1 */ // Screen X,Y coordinatates go from (-1,1) [Top Left] to (1,-1) [Bottom Right] // .Z coordinate of 0f = Draw on near clipping plane (as close to camera as possible) Vertices[i++] = new VertexPositionTexture(new Vector3(-1, 1, 0f), new Vector2(0, 0)); // Top Left Vertices[i++] = new VertexPositionTexture(new Vector3(1, 1, 0f), new Vector2(1, 0)); // Top Right Vertices[i++] = new VertexPositionTexture(new Vector3(-1, -1, 0f), new Vector2(0, 1)); // Bottom Left Vertices[i++] = new VertexPositionTexture(new Vector3(1, -1, 0f), new Vector2(1, 1)); // Bottom Right this.VertexDeclaration = new VertexDeclaration(graphicsDevice, VertexPositionTexture.VertexElements); }I can draw a GUI texture that covers the entire screen as follows: public void Draw(GraphicsDevice device, Effect effect_Current) { effect_Current.Parameters["xGUI_Transparency"].SetValue(transparency); //effect_Current.Parameters["xWorldViewProjection"].SetValue(Matrix.CreateOrthographic(device.Viewport.Width, device.Viewport.Height, 0.0f, 1.0f)); effect_Current.CurrentTechnique = effect_Current.Techniques["GUI_Transparent"]; effect_Current.Begin(); foreach (EffectPass pass in effect_Current.CurrentTechnique.Passes) { pass.Begin(); graphicsDevice.VertexDeclaration = fullScreen_VertexDeclaration; graphicsDevice.DrawUserPrimitives<VertexPositionTexture>(PrimitiveType.TriangleStrip, fullScreen_Vertices, 0, 2); pass.End(); } effect_Current.End(); }HLSL code://=============================================//----------- [XNA to HLSL Variables] ---------//=============================================float xGUI_Transparency;//=============================================//------------- [Texture Samplers] ------------//=============================================texture xTexture0;sampler textureSampler = sampler_state{texture = <xTexture0>;magfilter = LINEAR;minfilter = LINEAR;mipfilter = LINEAR;// No need for AddressU & AddressV};//=============================================//------------------ [Structs] ----------------//=============================================struct VertexToPixel{float4 Position : POSITION;float2 TexCoord: TEXCOORD0;};struct PixelToFrame{ float4 Color : COLOR0;};//=============================================//------ Technique: Draw Transparent GUI ------//=============================================VertexToPixel PassThroughVertexShader(float4 inPos: POSITION0, float2 inTexCoord: TEXCOORD0){VertexToPixel Output = (VertexToPixel)0;Output.Position = inPos;Output.TexCoord = inTexCoord;return Output;}PixelToFrame TransparentGUI(VertexToPixel PSIn) : COLOR0{PixelToFrame Output = (PixelToFrame)0; float4 samplePos = tex2D(textureSampler, PSIn.TexCoord); Output.Color = samplePos; Output.Color.a = xGUI_Transparency;return Output;}technique GUI_Transparent{pass Pass0 { AlphaBlendEnable = true;// Setup For Alpha BlendingZEnable = true;// Setup For Alpha BlendingZWriteEnable = false;// Setup For Alpha BlendingSrcBlend = SrcAlpha;// Normal Alpha BlendingDestBlend = InvSrcAlpha;// Normal Alpha BlendingBlendOp = Add;// Normal Alpha Blending VertexShader = compile vs_1_1 PassThroughVertexShader(); PixelShader = compile ps_2_0 TransparentGUI(); }}However, how would I draw something over the top of that without any z fighting and only in a certain location. For example a crosshair in the center of the screen or an enemy boss health bar at the top of the screen?Thank you.
Can you not simply turn off z-testing and draw your gui stuff back to front? ; Ooops, yes I can turn off z testing as follows, but wont this affect transparency if some textures are of different alphas?ZEnable = true;ZWriteEnable = false;I guess the real problem I am having is positioning the crosshair and health bars on the screen.
XNA Visual C#
For Beginners
Hi everyone,Yesterday I asked about which languages would be suitble for the development of games on the Xbox Arcade platform. Everybody told me to use either C# or XNA, so can any one tell me any good books that cover these languages, in addition to any other useful resources such as tutorials (I looked at the XNA creators site).Thanks,
I'd like to clarify a couple of terms here. C# is a programming language developed by Microsoft. Visual Studios (an Integrated Development Environment or IDE - a tool which lets you write, compile code, run, debug and many other useful programming tasks from the same environmnet) has a superb C# development environment. XNA is a library for C#. Libraries are not languages, instead it provides some additional capabilities which you can access through a programming language. XNA is not a language. C# is a language which can let you use XNA. You will need both C# and XNA to develop for the Xbox.And if I have my nomenclature correct, when I say XNA here, I really mean XNA Game Studio. ; You can't develop on Xbox Live Arcade unless you're a registered Xbox developer. This usually means either having a publisher, or that you've managed to convince Microsoft to release the game for your on XBLA. For that you can either use the regular XDK which uses native C++, or you can use a "pro" version of XNA Game Studio.If you're not a registered developer, then you can use XNA to create a game for Xbox Live Indie Games (formerly Xbox Live Community Games). The only officially supported language for XNA is C#.
Using ODE?
Math and Physics;Programming
Hi guys!I am currently thinking about using the Open Dynamics Engine in my game which will use physics lot. Normally I try to stay away from 3rd party products as much as I can but i had to integrated ODE into my engine for a university project and i am so far quite impressed with it. Has someone of you had experience with ODE? Would you recommend it? Were there any pittfals? Otherwise i would stay and improve my own physics engine... Maybe i am a little bit frightened of losing control :)Thanks for any input! :)
I'd say... go for it!It's pretty easy to use, the community support is good, it's open source, so you'll never really loose control! Also, it's quite lightweight, compared to other available options (havok, physx).
Trouble with classes
Graphics and GPU Programming;Programming
Ok so I followed a tutorial and got a pretty nice terrain engine with nice water, moving clouds, and billboard trees. That however is where the tutorials stopped. I am now trying to expand on it with my growing knowledge of C# and XNA but I am having problems with classes. The tutorial had everything located with in the game1.cs file but it is getting kind of long and so I would like to put the terrain stuff into one class, camera into another class, audio into another class and so on. I decided that instead of trying to convert what I had I should try and start over and reorganize everything so here is what I have so farTerrain.cs:using System;using System.Collections.Generic;using System.Linq;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Audio;using Microsoft.Xna.Framework.Content;using Microsoft.Xna.Framework.GamerServices;using Microsoft.Xna.Framework.Graphics;using Microsoft.Xna.Framework.Input;using Microsoft.Xna.Framework.Media;using Microsoft.Xna.Framework.Net;using Microsoft.Xna.Framework.Storage;namespace Game_Engine{ class Terrain { VertexPositionColor[] vertices; private VertexDeclaration myVertexDeclaration; public GraphicsDevice device; public GraphicsDevice Device { get { return device; } set { device = value; } } public void SetUpVertices() { vertices = new VertexPositionColor[3]; vertices[0].Position = new Vector3(-0.5f, -0.5f, 0f); vertices[0].Color = Color.Red; vertices[1].Position = new Vector3(0, 0.5f, 0f); vertices[1].Color = Color.Green; vertices[2].Position = new Vector3(0.5f, -0.5f, 0f); vertices[2].Color = Color.Yellow; this.myVertexDeclaration = new VertexDeclaration(this.device, VertexPositionColor.VertexElements); } public void Draw(GraphicsDevice device) { device.VertexDeclaration = myVertexDeclaration; device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1); } }}Game1.cs:using System;using System.Collections.Generic;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Audio;using Microsoft.Xna.Framework.Content;using Microsoft.Xna.Framework.GamerServices;using Microsoft.Xna.Framework.Graphics;using Microsoft.Xna.Framework.Input;using Microsoft.Xna.Framework.Net;using Microsoft.Xna.Framework.Storage;namespace Game_Engine{ public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; GraphicsDevice device; Effect effect; VertexDeclaration myVertexDeclaration; Terrain terrain; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { graphics.PreferredBackBufferWidth = 500; graphics.PreferredBackBufferHeight = 500; graphics.IsFullScreen = false; graphics.ApplyChanges(); Window.Title = "Riemer's XNA Tutorials -- Series 1"; terrain = new Terrain(); base.Initialize(); } protected override void LoadContent() { device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(GraphicsDevice); effect = Content.Load<Effect>("effects"); terrain.SetUpVertices();} protected override void UnloadContent() { } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { device.Clear(Color.DarkSlateBlue); effect.CurrentTechnique = effect.Techniques["Pretransformed"]; effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); terrain.Draw(device); pass.End(); } effect.End(); base.Draw(gameTime); } }}If any one could help me figure this out I would be very happy!The error I am getting is:Object reference not set to an instance of an object.and it is referring to the bold part in Terrain.cs
The device variable in your Terrain class is null.You need to pass through a reference to the device from your main Game1 class, preferably through the constructor of you Terrain class.Add the following to your Terrain class:public Terrain(GraphicsDevice device){ this.device = device}Then in your main Game1 class replace:terrain = new Terrain();With:terrain = new Terrain(graphics.GraphicsDevice);Also, the "this"s on this line are redundant:this.myVertexDeclaration = new VertexDeclaration(this.device, VertexPositionColor.VertexElements);; Ok Now I have a new problem yet same type of problem. I am now trying to setup a class for the camera. If I set it up the same way I set up the terrain class then I get just the plain window with nothing drawn but if I don't put the device stuff then I get the same error I was getting with the terrain class:Object reference not set to an instance of an object.Here is the camera class. the way it is currently setup I get only the windowusing System;using System.Collections.Generic;using System.Linq;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Audio;using Microsoft.Xna.Framework.Content;using Microsoft.Xna.Framework.GamerServices;using Microsoft.Xna.Framework.Graphics;using Microsoft.Xna.Framework.Input;using Microsoft.Xna.Framework.Media;using Microsoft.Xna.Framework.Net;using Microsoft.Xna.Framework.Storage;namespace Game_Engine{ class Camera { Matrix viewMatrix; Matrix projectionMatrix; private GraphicsDevice device; public Camera(GraphicsDevice device) { this.device = device; } public void SetUpCamera() { viewMatrix = Matrix.CreateLookAt(new Vector3(0, 0, 50), new Vector3(0, 0, 0), new Vector3(0, 1, 0)); projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, device.Viewport.AspectRatio, 1.0f, 300.0f); } }}Where I get the error When its the other way is with the projectionMatrix ; If you're just setting up a camera all you should see is the window. If you're not drawing anything you shouldn't expect to see anything.Anything you draw needs to be able to get at the camera's view and projection matrices to be able to draw them in view space. ; Ok I have stopped working on the camera class for right now and just included the camera in the game1.cs file. I kept on working had it so I could draw an array of Triangles then I changed my setupvertices method and I started once again getting a null reference exception on the setupvertices method.vertices[x + y * terrainWidth].Position = new Vector3(x, heightData[x, y], -y);that is where I am getting the null reference exception. I guess I am just not getting what a null reference exception means. It says to use new which I do use new there so I am not sure what is going on.Here is my terrain.cs and game1.cs code files:Terrain.csusing System;using System.Collections.Generic;using System.Linq;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Audio;using Microsoft.Xna.Framework.Content;using Microsoft.Xna.Framework.GamerServices;using Microsoft.Xna.Framework.Graphics;using Microsoft.Xna.Framework.Input;using Microsoft.Xna.Framework.Media;using Microsoft.Xna.Framework.Net;using Microsoft.Xna.Framework.Storage;namespace Game_Engine{ class Terrain { VertexPositionColor[] vertices; public VertexDeclaration myVertexDeclaration; private GraphicsDevice device; int[] indices; private int terrainWidth = 4; private int terrainHeight = 3; private float[,] heightData; public Terrain(GraphicsDevice device) { this.device = device; } public void SetUpVertices() { vertices = new VertexPositionColor[terrainWidth * terrainHeight]; for (int x = 0; x < terrainWidth; x++) { for (int y = 0; y < terrainHeight; y++) {vertices[x + y * terrainWidth].Position = new Vector3(x, heightData[x, y], -y);vertices[x + y * terrainWidth].Color = Color.White; } } myVertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements); } public void SetUpIndices() { indices = new int[(terrainWidth - 1) * (terrainHeight - 1) * 6]; int counter = 0; for (int y = 0; y < terrainHeight - 1; y++) { for (int x = 0; x < terrainWidth - 1; x++) {int lowerLeft = x + y * terrainWidth;int lowerRight = (x + 1) + y * terrainWidth;int topLeft = x + (y + 1) * terrainWidth;int topRight = (x + 1) + (y + 1) * terrainWidth;indices[counter++] = topLeft;indices[counter++] = lowerRight;indices[counter++] = lowerLeft;indices[counter++] = topLeft;indices[counter++] = topRight;indices[counter++] = lowerRight; } } } public void LoadHeightData() { heightData = new float[4, 3]; heightData[0, 0] = 0; heightData[1, 0] = 0; heightData[2, 0] = 0; heightData[3, 0] = 0; heightData[0, 1] = 0.5f; heightData[1, 1] = 0; heightData[2, 1] = -1.0f; heightData[3, 1] = 0.2f; heightData[0, 2] = 1.0f; heightData[1, 2] = 1.2f; heightData[2, 2] = 0.8f; heightData[3, 2] = 0; } public void Draw(GraphicsDevice device) { device.VertexDeclaration = myVertexDeclaration; device.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3); } } class Skydome { } class DNCycle { } class Weather { } class Water { }}Game1.csusing System;using System.Collections.Generic;using Microsoft.Xna.Framework;using Microsoft.Xna.Framework.Audio;using Microsoft.Xna.Framework.Content;using Microsoft.Xna.Framework.GamerServices;using Microsoft.Xna.Framework.Graphics;using Microsoft.Xna.Framework.Input;using Microsoft.Xna.Framework.Net;using Microsoft.Xna.Framework.Storage;namespace Game_Engine{ public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Effect effect; GraphicsDevice device; Matrix viewMatrix; Matrix projectionMatrix; private float angle = 0f; Terrain terrain; devicemanager graphicsman; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void Initialize() { graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 600; graphics.IsFullScreen = true; graphics.ApplyChanges(); Window.Title = "Game Engine Alpha"; graphicsman = new devicemanager(); graphicsman.graphicsmanager(); terrain = new Terrain(graphics.GraphicsDevice); base.Initialize(); } protected override void LoadContent() { device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(GraphicsDevice); effect = Content.Load<Effect>("effects"); terrain.SetUpVertices(); terrain.SetUpIndices(); terrain.LoadHeightData(); SetUpCamera();} public void SetUpCamera() { viewMatrix = Matrix.CreateLookAt(new Vector3(0, 10, 0), new Vector3(0, 0, 0), new Vector3(0, 0, -1)); projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, device.Viewport.AspectRatio, 1.0f, 300.0f); } protected override void UnloadContent() { } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); angle += 0.005f; base.Update(gameTime); } protected override void Draw(GameTime gameTime) { device.Clear(Color.DarkSlateBlue); device.RenderState.CullMode = CullMode.None; device.RenderState.FillMode = FillMode.WireFrame; effect.CurrentTechnique = effect.Techniques["Colored"]; effect.Parameters["xView"].SetValue(viewMatrix); effect.Parameters["xProjection"].SetValue(projectionMatrix); effect.Parameters["xWorld"].SetValue(Matrix.Identity); Vector3 rotAxis = new Vector3(3 * angle, angle, 2 * angle); rotAxis.Normalize(); Matrix worldMatrix = Matrix.Identity; effect.Parameters["xWorld"].SetValue(worldMatrix); effect.Begin(); foreach (EffectPass pass in effect.CurrentTechnique.Passes) { pass.Begin(); terrain.Draw(device); pass.End(); } effect.End(); base.Draw(gameTime); } }}; You are trying to set up your vertices before calling your LoadHeightData function, meaning your heightData array is empty, ie. null.NullReferenceExceptions are usually pretty easy to figure out. Basically it means you've not initialised one of the variables you are reading from/passing to a method.How much C# did you know before you used Riemers tutorials? They are good for getting going with XNA, but assume you vaguely know what you're doing with C#.I'd recommend doing some learning based around C# before going much further. There are plenty of good sites out there with free tutorials.If you're too lazy for that then download a sample from the Creators club, or something not too complex from Ziggyware and try figuring out how the various clases etc. interact within it. Although I wouldn't recommend this method for you, as it seems you're not that experienced with OO languages or programing in general.PS. For big chunks of code use source tags in your post, rather than code ones. ; I Knew some C# I knew some of the very basics of C++, C#, Java, Python, and PHP (My knowledge of PHP has helped me a-lot! I can't believe how much PHP and C# are alike in code structure.)I also have all of the 3D Buzz XNA 101 Video tutorials (all over 200 hours worth) which teach you C# and XNA at the same time. I have watched over 60 of those video tutorials so far. ; Ok another question. I am not going to post all my code just the parts I am working on. I am trying to create a class for keyboard input. I create the classclass KeyboardControl { private float angle = 0f; public void Update() { KeyboardState keyState = Keyboard.GetState(); if (keyState.IsKeyDown(Keys.Delete)) angle += 0.05f; if (keyState.IsKeyDown(Keys.PageDown)) angle -= 0.05f; } }I then Initialize it like I shouldKeyboardControl control;control = new KeyboardControl();Then in the update method I put control.Update(); Everything builds just fine and it displays my lovely wire frame terrain mesh but when I push the page down and delete keys it doesn't spin around like it should. I did add the code to the draw method to take into account the rotation so its not that. When I place the KeyboardState code right into the update method it works fine but its not working from the keyboardcontrol class. ; Your keyboard class is only updating it's internal angle variable, which you've declared as private and so is not accessable from outside the class.Whereas I'm guessing either your Game1 class or Terrain class has an angle variable, which when you put the Keyboard code in there it's updating and this is the one it's using.(I did say go learn more about C# and OO programing...)Personally I'm not a fan of putting input management into a seperate class, I tend to keep the input code in with the relavent class the input is updating. I'm not saying this is the right way of doing it, I'm just offering it up for suggestion.
What books did developer read for game development in the 1990s?
For Beginners
I want to make a game But I wonder how game developers worked in the 1990s, how they made games, how they learning before the Internet became as widespread as it is today. etc.how do they know how to build game mechanics as character ability power up system?how they know to reverse engineering game competitor company.what book I should read?
As far as I know (not being a programmer myself), books on the subject started appearing in the early 2000s. Up to that point, it was “learn by doing” and tips from one another. ;The first book that came to mind was Tricks of the Game-Programming Gurus: Lamothe, Andre, Ratcliff, John, Tyler, Denise: 9780672305078: Amazon.com: Books, which was geared toward beginners/students/amateurs. There were others, but that's the best selling pre-2000. After that point in time, game development became a hot topic in the book publishing world. Even GameDev.net has a series - Beginning Game Programming: A GameDev.net Collection (Course Technology Cengage Learning): 9781598638059: Computer Science Books @ Amazon.com.Otherwise, in the professional realm a lot was “learn by doing” as Tom said, or through word of mouth on early Usenet/IRC/websites (pre-GameDev.net in 1999 - see About GameDev.net). ;Computers in that era didn't have an OS like we have today. The machine booted, and you were dropped in a command shell or in an interactive BASIC interpreter. You basically programmed directly at the metal. Video memory was directly accessible, by writing in a known address range you could make pixels appear at the screen in various colors. The “OS” had a corner in the memory too for its data, but nothing prevented you from poking around there. Lua, Python, C#, C++ didn't exist, ANSI-C was just invented (K&R book about that was in 1989 iirc). Assembly language of course did exist (with books) and was used.Monthly computer magazines were published for all types of home computers. Tips and tricks were exchanged in that way, also program listings were printed in those magazines that you could then enter at your own computer. Studying those listings, and trying things for yourself is how you learned. There was also technical documentation about the computer.If you want to enjoy that stuff, today there is a retro-computing movement, that lives in that era, except with slight more modern hardware but still no OS, etc.;Alberth said:Computers in that era didn't have an OS like we have today.In the 1990s there was MSDOS, Several versions of Windows, and of MacOS. And that's not all the operating systems of the nineties, most likely.Like Linux, for instance.;Tom Sloper said:Alberth said:Computers in that era didn't have an OS like we have today.In the 1990s there was MSDOS, Several versions of Windows, and of MacOS. And that's not all the operating systems of the nineties, most likely.Like Linux, for instance.Yep. There were things like Windows 95, Win 98, and at the time I was still using a Commodore Amiga (AmigaOS) .To deal with the original question “what game dev books was I reading in the 90s?” Back in that era, one of my favorites was : The Black Art of 3D Game Programming by André LaMothe. ;Abrash was the guy who did the Windows NT graphics subsystem and worked on Quake.https://www.drdobbs.com/parallel/graphics-programming-black-book/184404919 ;There are a couple of" history of video games" books, that track the rise of the medium and genre.Just google for them. ;GeneralJist said:There are a couple of" history of video games" booksThat's not what the OP is looking for.;Thanks all
Choosing a career in AI programmer?
Games Career Development;Business
Hello everyone, my name is Ramon Diaz; I am currently studying Game development and programming at SNHU. I have taken the initiative to learn about a professional career in AI programming. I have a lot of gaps in my development in the short term. I have blueprint experience with AI but not enough to choose a career in this profession. I would like to know how I can be competitive leaving the university in 5 months after finishing my studies. I am looking for knowledge from all of you who have been in the industry for years.
Entry level? Know your algorithms, it will help you at interviews. If you have made demos it can help you get jobs, but the market is wide open right now and should be relatively easy to find work for the foreseeable future. Overall, it reads like you are on the right path. When you graduate and start looking for work, be open to any positions rather than just an AI specialty. Once you have a job it is easier to transition into whatever specialty you prefer.;Thank you. ;I would like to know how I can be competitive leaving the university in 5 months after finishing my studies.Talk about last minute. Create AI projects? Or A game with character behaviors? Pathfinding examples. Crowd movements. Anything really. Learn how navigation meshes work.;@dpadam450 Character Behavior is what I doing in the project at this moment. Everything related to AI programming.;@dpadam450 Is it the same when learning C++ in AI as visual scripting Blueprint? If I were to make a demo, what kind of programming should I focus on my attention? ;@frob It is important to have a portfolio? ;Not for programming. You will need to show you know how to do the work, but it is usually some interview questions and writing some code of their choice. If you have something you want to share with them, you can do it if you want. Having done fancy demos can sometimes help get interviews, and can help show your interest and abilities, but it is generally not needed. It does not hurt, unless you do it badly and therefore becomes a cautionary warning. Build it if you want. I have interviewed and hired bunches of programmers without portfolios. ;I'm studying AI at the moment, in terms of statistical learning. I've learned so much about AI over the past few weeks. Check out: https://hastie.su.domains/ISLR2/ISLRv2_website.pdf​andMachine Learning with R: Expert techniques for predictive modeling, 3rd Edition
Newbie desperate for advice!
Games Business and Law;Business
Hi allI'm new to the game development community and need some advice.I've created 2 educational games with a simple idea but are sufficiently challenging for all ages. These could be played on pcs or phones.Is it worth patenting any parts of the games?What would be the best way to monetize?How should I market the games?
hendrix7 said:I'm new to the game development communityReally? Your profile shows that you've been a member here since 2004, and your last activity was in 2007, asking about raycasting.hendrix7 said:Is it worth patenting any parts of the games?Probably not. Expensive and there will be hurdles, and possible lawsuits after the patent is granted (if it is).hendrix7 said:What would be the best way to monetize? How should I market the games?There are several threads here in the Business and Law forum about that. While you wait for more replies from the community, you can read up on those previous answers to those questions. Mainly, “you should have thought about that before you finished your games.” (You wouldn't be “desperate” now.) Good luck with your sales!;@hendrix7 Filing for a patent can be expensive, and you need to document the solution and how it separates from anything else. I have developed software that solved problems in a way that no other software does, but there is only a very small portion of that that can actually be patented. Even though you can file an application yourself, I would recommend hiring an experienced IP attorney. This too is very expensive, though, so you are best off doing this if this idea can provide millions in income. If it can't, then it's actually not that harmful if anybody copies it.You could look at registering trademarks, design and other parts of the games. This is cheaper, but it will protect you brand more than your idea or solution.Again, if this is something that could turn a real profit, it might be worth looking into. If not, it's a very costly waste of time.As for marketing - my day job is actually creating videos and commercials etc., so naturally that's the first thing that comes to mind.Make videos for social media or other platforms where your target audience is likely to see it. Oh, and you need to define a target audience. Know where they are, what they respond to, what their struggles are and how your product will solve their problems, enhance their life experience or in other ways contribute positively to their life.There are several other ways to do this, but the list exceeds my level of expertise in the area.;patenting is costly, and time intensive. As said above, it depends on a lot if it's worth it. ;@hendrix7 Nothing is worth patenting unless you're willing and able to defend your patent. There is no patent police; you're responsible for finding and prosecuting infrigement.What you're patenting has to be novel and non-obvious to a person skilled in the art. You called your idea ‘simple’ which makes me wonder if it's obvious or already in use.;@Tom Sloper Thanks TomI have been programming for a while but not games until now.Thanks for getting back and your advice, particularly patents.;@scott8 Thanks for your reply.I see. The play of the game utilises basic maths skills so I'm guessing it'll be difficult to identify anything that's unique. I suppose, in a similar way, it would be difficult to patent something like ‘Wordle’. Am I right?
Hi I'm new. Unreal best option ?
For Beginners
Hallo everyone. My name is BBCblkn and I'm new on this forum. Nice to virtually meet you 🙂. One of my biggest dreams is to make my own videogame. I love writing design as in text on how my dream game would be. Now I got no skills to create it. But who knows what life will bring. Is Unreal the best program to have fun with an experience ? Obviously I prefer a simple but capable program. Not pre designed auto drop. Why not install Unreal and roam into it and see if anything happens.My favorite games are in the genre of Fantasy, usually stone age with magic. Dota, Homm, Diablo and the odd one out is the genius Starcraft 1. But I played plenty of different games, especially when I way younger. I don't game currently at all but designing gets my creative juices flowing and is so inspiring and fun. Thanks for having me guys
BBCblkn said:My name is BBCblknI am truly sorry for you. Even Elons daughter has a better name than that.BBCblkn said:Is Unreal the best program to have fun with an experience ?Give it a try, but it's not meant for total beginners.Starting small always is a good idea. 2D is easier than 3D. You could try GameMaker, learn some programming language, learn some math, move on to more advanced engines like UE or Unity… ;There's honestly no perfect program for beginners. If I had to compare Unreal though at my skill level, I would probably pick Unity. However, It really comes down to your needs, and how much programming you want to learn. Furthermore, I would also keep in mind other engines.;@BBCblkn I'd recommend Gamemaker studio 2 as a first engine. It's easy to learn and I haven't had a problem making my game ideas in it yet.There are some good tutorials on YouTube to follow to learn it. Do note you'll be limited to 2D games with GMS2.Bit late to the post, but I hope it helps;gamechfo said:Bit late to the postTwo months late. Always consider whether you honestly believe that a question asked long in the past is still awaiting an answer. Thread locked.
How to publish a book?
GDNet Lounge;Community
Hello, So, over the holidays I finished my 1st book. Do any of yall writer types know where I can find:an editorpublisherIt's like 99% done, just need to know what to do next. Also, it's cross genre, so it doesn't necessarily fit the standard model.
You've given nowhere near enough information to get a final answer, but I can suggest next steps for you. (For background, I've worked as an author, co-author, editor, and ghostwriter on 9 books so far.)Publishing is a business deal. You need to figure out what business services you need.Do you even need a publisher? Do you need a distributor? You already mention needing an editor. Do you need marketing? Do you need retail agreements? Digital or physical? If physical, POD or offset, how many each of hard or soft, what size of print run can you afford? What business services do you need? Publishers have an awful lot of potential features of what they can provide and what those services cost.Once you know the list of services you actually need, your favorite bookstore will have books that have listings of all the major publishers and hundreds of minor publishers, along with the services they provide and the specialties they work with. Work through the listings methodically, and talk to them all until you've got a deal. You'll also want to start shopping around for a lawyer at that point, both because they have connections and because they'll be working with the contracts you'll be signing.Once you know what you need and have talked with your lawyer the first few times, you will be ready to start shopping around. It's far better if you have more money and are using the publisher as a paid service. That is, you pay them for the services they provide up front. It will cost you many thousand dollars but you'll require far fewer sales to reach profitability. It can be better to do an online plus POD service starting out if you're self funded. If they need to front any of the money there will be two phases to the deal, one phase before it's profitable and another after a threshold is reached and it's profitable. The exact terms will depend on your needs and the services they'll be providing. Before you sign with anyone, you'll need to work back and forth more than once with your lawyer to help you negotiate what's fair in the agreement. Good lawyers understand the costs of the various services and can help you get fair rates.Just like publishing games, the more you need from them the harder your pitch becomes. If you need a lot of services the more it will cost you. If you're looking for them to invest in you, front you money, and pay for the books, don't expect a lot of money from the deal, and in addition your pitch needs to be amazing and you'll be rejected many times. If you've got the money to self-publish and are only looking for retail agreements that's rather easy. ;hmmmWell Self publish might work too. I'm looking for:an editor publishing distribution for ebookNo hard cover or physical book planned at this timemaking cover art. Future Audio book production. I think that's it. I'd be willing to do physical print if needed, but I don't really want to pay for that at this time. frob said:You've given nowhere near enough information to get a final answer The issue is I don't know what questions or criteria I should be asking or looking for. ;Have you considered publishing with Packt?https://www.packtpub.com/;GeneralJist said:2. publishing distribution for ebook 3. No hard cover or physical book planned at this timeFor distribution of an ebook there are plenty of options. Amazon is the biggest with kindle direct publishing requiring little more than an html file and an image for the title. If you are comfortable with software tools you can use that same document to build/compile every other format out there. You're on the hook for everything else with the business if you go that route, but it can work well if you are marketing through your own channels.There are many ebook publishers out there targeting specific platforms and specific readers or specific genres. I mentioned publisher lists, they also include electronic-only publishers. Understand the tools they use against piracy are also helpful since otherwise anybody with access to the file can make unlimited copies.Be careful of contracts, you almost certainly want something that has a non-exclusive agreement since you've done all the work yourself already. If a publisher wants an exclusive deal they need to be putting quite a lot on the negotiating table.GeneralJist said:4. making cover art.Find an artist with the style you like and contact them. Often it's in the range of a couple hundred bucks, especially for ‘unknown’ artists when they're starting with something that wouldn't have seen the light of day otherwise. Artist friends are best, and asking around at local art schools is inexpensive.GeneralJist said:5. Future Audio book production.If you don't need it now, it's something easily done later.GeneralJist said:1. an editorThis one is the most difficult. Skilled editors are amazing. If you go with a publishing house they'll provide professional editors, at professional rates. ;taby said:Have you considered publishing with Packt?https://www.packtpub.com/hmmm 1st time hearing of them.Looks like they are more of an educational option?My book is a mix of mental health journey auto bio, and Sci Fi elements. It's not really a standard “how to” for game dev. ;so I just heard back from my 1st publisher submission.https://triggerhub.org/​And they essentially say they be willing to look at it deeper, and have extensive edits to focus on the mental health angle. but they would want me to cut a lot. From what they are hinting at, It sounds like they want to cut a lot of the Game dev and gaming journey, as they are a publisher focused on mental health.So, now I need to decide what to do.I sent them back an email saying I'm open to continued dialogue.Without knowing exactly what they want to cut, and edit, I don't know how to proceed.Also, would it be better to hold out, and find a publisher that is willing to accept most of the game dev journey, as I'm looking for a continued publisher to work with, aka accept most of the book as is. Any advice would be helpful.Thanks yall. ;GeneralJist said:Any advice would be helpful.Look into your own mind and heart.;hmmmok,So I've submitted to a few other places.We shall see.I submitted to this place called author House, and they got back to me really quick, but it looks like they want me to pay a couple thousand for a package:https://www.authorhouse.com/en/catalog/black-and-white-packages​I personally find that a bit frustrating.I mean, really, I wrote the book, I thought traditional publishers get paid from a % of sales?@frobWhat do you think?Is the above package a good deal?I was also a little put off, as it seems the person who called me didn't even read anything about my book, and asked me “so what's your book about?"beyond the above, how does this usually work? Edit: so, after a bit of basic research, it seems the above organization is a bit scamy. The hunt continues. ;You're unlikely to get a publisher deal, where the publisher pays you an advance and distributes your book to retail outlets.You'll have to self-publish, meaning you have to bear all the costs for printing, and nobody will distribute it for you. https://en.wikipedia.org/wiki/Vanity_press​
First-person terrain navigation frustum clipping problem
General and Gameplay Programming;Programming
I am trying to develop first-person terrain navigation. I am able to read a terrain and render it as well as to move around the terrain by interpolating the location of the camera every time I move around. The main problem I have is that depending on the terrain, i.e. moving on a sloping terrain, the near plane clips my view (see below). What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.
I believe this can aways be an issue. I mean if you are clipping to a near plane and that plane passes through geometry, it has to do something. That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it. Another other thing to consider is once you have collision working, you can put your camera, including your near clipping plane inside a collidable object, for instance a sphere, such that this problem will never occur. If you are eventually going to make this a real first-person game, that should take care of the problem since your camera will be inside the players head. Even in a 3rd person game you can put them inside a floating sphere. ;Gnollrunner said:That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it.The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.mllobera said:What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.Yes, basically you want to ensure that the camera is in empty space (above the hightmap), not in solid space (below the heightmap).But in general you can not treat the camera as a simple point, because the front clip plane requires a distance larger than zero. So ideally you build a sphere around the camera which bounds the front clip rectangle of the frustum, and then you make sure the sphere is entirely in empty space, for example. In the specific case of your terrain not having too steep slopes however, it should work well enough to sample height below camera, add some ‘character height’, and place the camera there. That's pretty simple and usually good enough for terrain.It's quite a difficult problem mainly for 3rd person games in levels made from architecture. It's difficult to project the camera out of solid space in ways so the motion still feels smooth and predictable.Some games additionally fade out geometry which is too close, attempting to minimize the issue.Imo, the ‘true’ solution to the problem would be to let the clipping happen, but rendering the interior volume of the geometry as sliced by the clipping plane.That's pretty hard with modern rendering, which usually lacks a definition of solid or empty space. But it was easy to do in the days of Doom / Quake software rendering. When i did such engine, it was possible to render clipped solid walls in simple black color. This felt really robust and not glitchy, so while it does not solve all related problems, i wonder why no game ever did this. ;@undefinedJoeJ said:The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.You can clip to a pyramid instead of a frustum. I used to do this many years ago on old hardware. So there is no near clipping plane. In fact you don't need a far clipping plane either.Edit: Just wanted to add as far as I know the near and far clipping planes mostly have to do with optimizing your Z resolution. If you are dealing with that in other ways, I think they aren't strictly necessary. I currently don't even deal with the far plane and let LOD solve Z-fighting issues.;Gnollrunner said:You can clip to a pyramid instead of a frustum.I see. You still have front clip. It is a point, formed indirectly as the intersection of the other other frustum planes.I've misunderstood your claim to be ‘you don't need a front clip’. But you didn't say say that. Sorry. But now i'm curious about the experience with z precision you have had. I guess it just worked? Which then would probably mean: All those painful compromises of ‘make front plane distant so you get acceptable depth precision for large scenes’, are a result of a bad convention being used by APIs?Or did you use no z-Buffer? ;@undefined My whole engine is based on aggressive LOD and culling. I don't do projection in the matrix. It's a post step. My Z coordinates are world distances. My current project does have a near clipping plane mainly because DirectX wants one, but it's not that relevant for my application.;Ah, so you use the pyramid for culling only. But for rasterization, the usual front clip plane at some distance i guess.Still an interesting question if ‘some distance’ is really needed, but i guess yes.I did some experiment about point splatting. It uses spherical projection, which is simple than planar projection:auto WorldToScreen = [&](Vec4 w){Vec4 local = camera.inverseWorld * w;if (local[2] < .1f) return (Vec3(-1)); // <- front clip at some distance of 0.1Vec3 screen = (Vec3&)local;screen[2] = length(screen); // if it was zero, i'd get NaN herescreen[0] = (1 + screen[0] / (screen[2] * camera.fov)) / 2;screen[1] = (1 + screen[1] / (screen[2] * camera.fov)) / 2;return screen;}; Planar projection would cause division by zero too, i guess.;Thanks for all your comments! I will need to investigate how to do what Gnollrunner proposed (about putting the camera inside of a sphere). ;This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, it likely makes some sense to have a smaller near-plane distance for the former than the latter.Now, this only ameliorates the problem, it doesn't remove it entirely: it means that the problem will still appear, but only if the player gets very close indeed to a surface. It's intended to be used in conjunction with one or another means of preventing the camera from approaching quite so near to a surface (such as the sphere-approach mentioned by others above).;Thaumaturge said:This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, I'm not sure that's so true. I mean in both cases you have to take care of the problem somehow. The case of a first-person camera is a bit easier because it should always be in the collision boundary of the player (sphere(s), ellipsoid, capsule etc.). As along as the near plane is also within that boundary, the problem should never occur. So if you have a 10cm radius sphere and put the camera in the back of it, that gives you maybe a 10 to 15 cm camera to near clipping plane distance to play with depending on the field of view you are going for. With a 3rd person camera, you can also get very close to terrain, in fact your camera can end up within terrain or some object if you don't do anything to solve that problem, and this will happen very often without separate camera collision. One typical way to handle this is just implement your following camera, ignoring terrain considerations. Then to figure out your camera's actual position, project a line back from the head of the avatar to the camera's ostensible position, and see if it intersects anything to get the camera's true position. In reality you should project a cylinder and not a line since your camera will need its own bounding sphere to contain the near clipping plane. In any case this means that as you move around your camera can jump forward to clear terrain and objects. I've seen this in a few MMOs. However, when you leave blocking terrain you have the option of implementing smooth movement back to the cameras desired location. If you want to get really fancy, I guess you could try to predict when your camera will need to jump forward ahead of time and try to do smooth moment forward too. Maybe you can have a second camera bounding sphere which is somewhat larger, that would trigger smooth movement, but I think you would still need a fallback camera jump routine to be safe.
new browser mmorpg
Your Announcements;Community
Hi guys.I have just start beta live version of my mafialifestyle mmorpg Please let me know whether you like it or not.Either way, I will be happy to get any request from you.It's completely made in php, some features are ajaxed.Some features are still missing, I'm still on heave development with that.http://www.mafiarevolution.comthanks.Peter.
limit of TEXCOORD in HLSL
Graphics and GPU Programming;Programming
Hi guys,I'm having some problems with HLSL.It happens that if I use this structure as the input of the pixel shader, it works:struct PS_INPUT{ float4 Position : POSITION;float2 Texture : TEXCOORD0; float3 Light: TEXCOORD1; float3 Normal : TEXCOORD2; float3 Camera : TEXCOORD3;float3 Pos : TEXCOORD4;};but it doesn't anymore if I exchange the position of the last two:struct PS_INPUT{ float4 Position : POSITION;float2 Texture : TEXCOORD0; float3 Light: TEXCOORD1; float3 Normal : TEXCOORD2; float3 Pos : TEXCOORD3; float3 Camera : TEXCOORD4; };WHY !!?!?Is it a limit problem ? Something that I'm doing wrong ???thanks a lot guys!
Hi,There's a TEXCOORDN limit but I think it depends on device capabilities. For example, I use HD2600 Pro and I can't use TEXCOORD4, TEXCOORD5, TEXCOORD6 etc.Try using COLOR12, COLOR13 etc. ; What pixel shader version are you using? PS versions <= 1.3 have a limit of 4 texture samples, PS 1.4+ has 6 according to the Documentation. ;Quote:Original post by programci_84Hi,There's a TEXCOORDN limit but I think it depends on device capabilities. For example, I use HD2600 Pro and I can't use TEXCOORD4, TEXCOORD5, TEXCOORD6 etc.Try using COLOR12, COLOR13 etc.I'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.Quote:Original post by Evil SteveWhat pixel shader version are you using? PS versions <= 1.3 have a limit of 4 texture samples, PS 1.4+ has 6 according to the Documentation.I'm loading the shaders with D3DXCompileShaderFromFile, where I specified the version "ps_2_0" and "vs_2_0". I tried to switch to the version 3 also, but nothing changed.thank you ; What does "works" and "doesn't work" mean? If TEXCOORD4 can hold the data for your Position, there's absolutely no reason it would behave differently if you stored your Camera position in there.Have you used PIX to debug your shaders and actually see what's going on? ;Quote:Original post by NiGoeaI'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.I have a GeForce 6800 too and it supports at least 6 texcoords. ;Quote:Original post by jpventosoQuote:Original post by NiGoeaI'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.I have a GeForce 6800 too and it supports at least 6 texcoords.I have a 8600 and it supports 8 texcoords and 32 texture image units. ;Quote:Original post by MJPWhat does "works" and "doesn't work" mean? If TEXCOORD4 can hold the data for your Position, there's absolutely no reason it would behave differently if you stored your Camera position in there.Have you used PIX to debug your shaders and actually see what's going on?Actually, I'm not using the parameter Pos. So I don't care if it works or not, I only know that if I set the Camera to use TEXCOORD4, nothing works.[anyway, somehow, I resolved the problem. Thanks !]
2D Box-Box Collision Issue
General and Gameplay Programming;Programming
So I have a collision problem :PHeres a picture will explain under it.http://i142.photobucket.com/albums/r110/firemanchrisz/CollisionProblem.jpgSo checking to see if Box1 and Box2 collide.If Box2 is travelling at a relatively highish speed, and arrives at position 1, doing some overlap tests, we see there is no collision. Then next update it moves to position 2, which is a collision but on the right side. So the collision response is based on it colliding the right side, which is causing issues in my remake of a Brick type game.I was hoping that someone could suggest a method that would help solve this issue.I have looked up vectors and think something to do with line intersection tests would help, but I dont want to use those if I can help it, I don't know the maths of it as yet, currently studying and thats coming next trimester.
I'm afraid you'll have to get familiar with vector maths. In the meanwhile, what you can try is to sub-divide your movement into small steps, and check along the way. It's not gonna be perfect though. again, it involves a little vector maths.Quote:const float step = 3; // three pixel stepping.Vector dir = (startpos - endpos); // direction of travel, normalisedfloat distance = dir.length();if(length > 0.00001f) dir /= length;// the stepping increment.float t = 0.0f;while(1){ // position of box A at the step. Vector p = startpos + dir * t; // test collision. Box temp = boxA; temp.setPosition(p); if(temp.collidesWith(BoxB))break; // move to next step. float dt = (distance - t); if(dt < 0.0000001f) return false; if(dt > step) dt = step; t += dt;}; Yep I was afraid of that, was sure that would be the answer, I was thinking about manually stepping Box2 in very small increments towards it's next position if it is near Box1. But I also think it'd be alot cleaner to just suck it up and look at vectors. Thanks :)If anyone else has ideas, the more the merrier. ; For this you would most likely want to use the continuous version of the separating axis test for axis-aligned boxes. You might check the articles sections here on GDNet - I think this specific algorithm is covered in one of the articles in the collision detection section. (I seem to remember the author of the article being Gomez, but don't quote me on that.)
Source Code To Windows 98
Old Archive;Archive
Comments for the article Source Code To Windows 98
This should be in Hungarian Notation. Thats what Microsoft uses for its code... ; respected siri beg to say that i want to get the free sourse code of win 98 by mail plz send me . thanking you, [email protected] ; Ok, I doubt that anyone will give you the source through email, its way too big. PS. That source code is hilarious! ; At the time where MS leaked some of the nt/2k sourcecode i found this:#include "win31.h"#include "win95.h"#include "win98.h"#include "workst~1.h"#include "evenmore.h"#include "oldstuff.h"#include "billrulz.h"#include "monopoly.h"#define INSTALL = HARDchar make_prog_look_big[1600000];void main(){ while(!CRASHED) { display_copyright_message(); display_bill_rules_message(); do_nothing_loop(); if (first_time_installation) { make_50_megabyte_swapfile(); do_nothing_loop(); totally_screw_up_HPFS_file_system(); search_and_destroy_the_rest_of_OS/2(); make_futile_attempt_to_damage_Linux(); disable_Netscape(); disable_RealPlayer(); disable_Lotus_Products(); hang_system(); } write_something(anything); display_copyright_message(); do_nothing_loop(); do_some_stuff(); if (still_not_crashed) { display_copyright_message(); do_nothing_loop(); basically_run_windows_3.1(); do_nothing_loop(); do_nothing_loop(); } } if (detect_cache()) disable_cache(); if (fast_cpu()) { set_wait_states(lots); set_mouse(speed, very_slow); set_mouse(action, jumpy); set_mouse(reaction, sometimes); } /* printf("Welcome to Windows 3.1&quot; */ /* printf("Welcome to Windows 3.11&quot; */ /* printf("Welcome to Windows 95&quot;*/ /* printf("Welcome to Windows NT 3.0&quot; */ /* printf("Welcome to Windows 98&quot;*/ /* printf("Welcome to Windows NT 4.0&quot; */ printf("Welcome to Windows 2000&quot; if (system_ok()) crash(to_dos_prompt) else system_memory = open("a:\swp0001.swp", O_CREATE); while(something) { sleep(5); get_user_input(); sleep(5); act_on_user_input(); sleep(5); } create_general_protection_fault();}It looks pretty much like the same code, i think it''s real; A newer version I think. This is fun! ; Ummm, somehow i dont think thats real considering that the computer isnt that slow that it waits 5 before updating everything and when the system is ok, it doesnt always crash right away. Its all just a joke whoever made it and now you guys saw it and think its real. But it sure is funny. ;Quote:Original post by Anonymous PosterUmmm, somehow i dont think thats real considering that the computer isnt that slow that it waits 5 before updating everything and when the system is ok, it doesnt always crash right away. Its all just a joke whoever made it and now you guys saw it and think its real. But it sure is funny.Everyone knows its a joke.Whoever said the hungarion notation thing: Not all the teams in MS use it, nowadays I think most don't. ; if (still_not_crashed) //aaargh,when it's going to crash? //It makes me really angry !!!!!!!!!!!!§{ set_cpu_voltage(220); //well,i think it will crash. ...} ; Funny. This is how Linux's install worked for me. :\
video capture - saving to an uncompressed AVI file
Graphics and GPU Programming;Programming
Hey.lets say my rendering thread reads all pixels every frame, wraps it in a object and pushes it into a linked list and i have another lower priority thread that at startup creates a new file on my hardrive and then constantly takes available frames from the list and writes it to the open file. when the application closes it waits for that thread to clear out the list and finalize.Question 1: is this a decent way of doing it?Question 2: does anyone know (or know where i could get) the format of uncompressed AVI files - im asuming it wont be that complex since it should contain little more than raw pixel data right?I'l worry about encoding the AVI's later for now i just want to get some basic capture functionality. I can stil use an external video converter to create encoded video's from uncompressed ones.Thnx in Advance![Edited by - EternityZA on June 24, 2009 9:21:13 AM]
Quote:Original Quote by EternityZAQuestion 1: is this a decent way of doing it?This is currently how I handle recording either live video from a camera or if I want to record the back buffer.However, depending on the size of the video and/or image, this could cause vast amounts of memory overhead. If you are queuing the images to put into the video then each image remains in memory. If the writing thread gets behind your image queue will increase in size and thus increase the amount of memory you are using.Quote:Original Quote by EternityZAQuestion 2: does anyone know (or know where i could get) the format of uncompressed AVI files - im asuming it wont be that complex since it should contain little more than raw pixel data right?If you are on windows, you can use the vfw library. This will also allow you to compress the video using any installed codec on your machine. I currently use XVID mostly, but you can still do uncompressed recording if required.- me ; That realy helps.Thnx Alot! :p
Eye Movement Simulation
Artificial Intelligence;Programming
I'm not sure that this forum really fits this topic or not, but here goes.I'm wanting to create an Eye Movement Simulation. It doesn't need to be 100% exact or anywhere near as fast as the actual human eye of course, it's just a concept I'm trying to demonstrate to some friends of mine.My ultimate goal would be to read from the entire computer screen, but as that would most likely be a terribly monumental task.. I'd be happy with nearly anything (such as 'watching' a movie or similar).My knowledge here isn't exactly of professional levels, so excuse any blunders and please correct me. To continue, I'm under the impression that the eye is typically going to center in on movement/luminescent differences/etc. So, a white dot on a full black screen will grab the person's attention for example. A moving white dot should in theory do even better.What I'd like to do is simply track changes from one moment to another, and display a 'center of focus' on the screen where the human eye is most likely being drawn to. I probably can't actually keep up with live changes, which is why I thought if I simply read an avi file or the like, I could pre-program the 'center of focus' and then run the overlay the same moment I start the video.This making sense? I'm not terribly great at explaining myself sometimes.My real question is how the hell would I do something like this, has anyone else attempted something like this, is there a professional version of this kinda thing out there I'm not locating, etc. Most of what I've found so far doesn't really do what I'm looking to accomplish. Not to mention, I'd like to have the source for such a thing :P.Thanks for any help, or just for simply reading all this.. lol.-MythicsEdit: Just to mention, I was just guessing regarding the "movement/luminescent differences" bit. I don't know without a doubt what the eye gets drawn to.[Edited by - Mythics on June 23, 2009 9:12:10 AM]
I'm not exactly meaning to bump my own thread, but I wasn't sure if only editing the previous post will show up as 'unread' to others or not.Can anyone help me out to at least confirm if I stuck this in the proper forum or not? The topic in itself is more of an Artificial Sense rather than Artificial Intelligence. The idea was founded on a discussion between me and a couple friends that to create a form of AI via Artificial Neural Network to 'read' onscreen data, I'd need a sort of 'front end' for the ANN that would project data to the ANN based on the 'center of focus'. That way, if the ANN was meant to confirm 'seeing' the letter A onscreen, it would need to be able to 'look around for it' rather than just learning by some static grid of on/off switches (like a digital clock for example).Again, my apologies if I'm not explaining myself easily.Thanks,Mythics ; I'm not quite sure on what your simulation is supposed to do, is it like this?Inputs: Bitmap/screen Last Eye Pos|_________________| |ProcessOutputs:| New Eye PosAnother question is, what is the purpose of this sim? ; I think the reason that no one jumped in was that your original post was a little scatter-shot and difficult to understand where you were headed. ; Do you want to search an image for the spot that sticks out the most?It's more of an image processing algorithm.. you could for example loop over all the pixels, and find the area of some radius where the image is the lightest, or where there are the clearest edges, etc. If you want to do it for movement, it's probably a lot harder. You would have to analyze several frames and find patterns that occur in all of them, and then see if the pattern has moved sufficiently, to pass some threshold needed to draw attention.Try searching for computer vision, starting with wikipedia for example: http://en.wikipedia.org/wiki/Computer_vision. ;Quote:Original post by HodgmanI'm not quite sure on what your simulation is supposed to do, is it like this?Inputs: Bitmap/screen Last Eye Pos|_________________| |ProcessOutputs:| New Eye PosAnother question is, what is the purpose of this sim?It is supposed to be like the ascii diagram you gave, where the process looks for what 'stands out' the most. The purpose of the simulation is to have a front end for an Artificial Neural Network for image recognition. This way, instead of just feeding in a set 10x10 grid of pixels for example, it could scan an image for 'note worthy objects' to feed into the ANN. (I don't intend to actually try anything so complicated as all that, I just wanted to show off an example of what the front end aspect would look like)Quote:Original post by Erik RufeltDo you want to search an image for the spot that sticks out the most?For the most part, yes. Quote:Original post by Erik RufeltIt's more of an image processing algorithm.. you could for example loop over all the pixels, and find the area of some radius where the image is the lightest, or where there are the clearest edges, etc.After putting some thought/research into how the human eye works, I believe the nearest thing I could really do is check for differences. White sticks out on black and black sticks out on white due to the difference in color. Take a checkerboard pattern as an example of a situation where the human eye can't figure out where it should center in on, and you might get a dizzying effect.Quote:Original post by Erik RufeltIf you want to do it for movement, it's probably a lot harder. You would have to analyze several frames and find patterns that occur in all of them, and then see if the pattern has moved sufficiently, to pass some threshold needed to draw attention.The eye is in constant motion, so it is never truly stationary. If it ever was, it wouldn't take very long for your sight to go black due to no 'changes' being read from the eye. So, my thought is to compare all pixels to their neighbors, calculate some amount of change between them, and 'guide' the center of focus towards the strongest and most dense area of change. If I did something like that, I could account for movement by comparing the previous frame to the current frame as well (like a third dimension, if that helps to picture what I mean). That way I'd be comparing a pixel to it's 8 neighbors within the current frame, and it's 9 neighbors from the previous frame.Doing as I just described is probably far from what I actually want the program to do, but I think it would satisfy enough scenarios for the demonstration I wanted to present without getting too terribly far into the complexity of trying to simulate actual vision processing.Quote:Original post by Erik RufeltTry searching for computer vision, starting with wikipedia for example: http://en.wikipedia.org/wiki/Computer_vision.Thanks for the terminology 'computer vision' and the link. It does look like a starting point if nothing else. I was searching for all sorts of stuff but never thought of that, lol.Thanks for the responses. I still don't know for sure if I'm explaining myself any better, but at least I'm getting some new ideas from ya :).[Edited by - Mythics on June 24, 2009 12:16:39 PM]; You need to look up "visual salience" (or saliency, I've seen both spellings). This is probably a good introduction: http://www.scholarpedia.org/article/Visual_salience. Itti and some other researchers might have code for their models online.In general, though, it's an open problem, and how the eye views the scene depends on many factors -- e.g. the task people are performing. It is also different for different people. And even the best existing models cannot predict it with 100% accuracy. ;Quote:Original post by Gil GrissomYou need to look up "visual salience" (or saliency, I've seen both spellings). This is probably a good introduction: http://www.scholarpedia.org/article/Visual_salience. Itti and some other researchers might have code for their models online.Thank you as well for this, it is most certainly helpful.Quote:Original post by Gil GrissomIn general, though, it's an open problem, and how the eye views the scene depends on many factors -- e.g. the task people are performing. It is also different for different people.I can't help but think that most infants would at least start out being drawn to very similar things. I would guess that the information the eye gathers over time will lead to the individual performing differently as well. Myself for example, I like to watch movies a second time typically to watch for things in the background that are most certainly not drawing my attention.There's a book called On Intelligence, by Jeff Hawkins that shows an illustration of a human face. The concept is that the saccade performed by the eye will typically lead the eye to points of interest. Just a neat piece of info imo. Thanks for the info, I'll give it a proper look over at work today.
Problem compiling "Beginning OPENGL Game programming SE" cd projects.
For Beginners
first off sorry but i didn't know where else to ask about this. i just hope maybe the book devs hang around here.none of the projects provided on the CD compile. i even grabbed the update from the website for the book. yet still they won't compile.i'm using VS2008 sp1 standard edition. on Vista Home Premium 64bit sp2. i have been trying to compile in release and debug mode w32. the problem is down to ZERO_CHECK project. here is the buildlog.Build Log Build started: Project: ZERO_CHECK, Configuration: Release|Win32 Command Lines Creating temporary file "C:\Users\Sammie\AppData\Local\Temp\BAT00000154882828.bat" with contents[@echo off"C:\Program Files\CMake 2.6\bin\cmake.exe" "-HC:/Users/luke/Desktop/BOGLGP Source/boglgp/Source/OpenGL 3.0/chapter_1/simple" "-BC:/Users/luke/Desktop/BOGLGP Source/boglgp/Source/OpenGL 3.0/chapter_1/simple/vc++" --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file "C:\Shared Temp Folder\OPENGL Game Programming\OpenGL 3.0\chapter_1\simple\vc++\simple.sln"if errorlevel 1 goto VCReportErrorgoto VCEnd:VCReportErrorecho Project : error PRJ0019: A tool returned an error code from "Checking Build System"exit 1:VCEnd]Creating command line "C:\Users\Sammie\AppData\Local\Temp\BAT00000154882828.bat" Output Window Checking Build SystemThe system cannot find the path specified.Project : error PRJ0019: A tool returned an error code from "Checking Build System" Results Build log was saved at "file://c:\Shared Temp Folder\OPENGL Game Programming\OpenGL 3.0\chapter_1\simple\vc++\ZERO_CHECK.dir\Release\BuildLog.htm"ZERO_CHECK - 1 error(s), 0 warning(s) it's the same for all the OPENGL3.0 projects on the cd.
Application start-up ping to server
General and Gameplay Programming;Programming
Hi,I am planning to distribute an application in 2 versions: a free and a paying version. The free version would be fully functional but not meant for commercial applications and an evaluation tag would be clearly visible. What I want to do is have the free version also send a start-up ping signal to a server for statistics purposes (the ping would just send the volume ID of the harddrive to a server each time the application is started).My question now is: I intend to inform the user about this ping signal in the license agreement during installation (where the user has to click "I agree" to continue installation. Is this enough? Would this still be considered as bad practice?edit: the application however doesn't require an internet connection to operate (except during registration) and if the user is not connected, the application will start normally without sending the ping.
I personally see nothing wrong with it, although rather than throw it in the license agreement which makes it seem as though you're trying to hide it (nobody reads them), I'd make it an option during install and in the program of allowing submission of anonymous statistics - something like that I wouldn't worry too much if it was already ticked either. ; Thank you for your input NewBreed.Actually the data that I want to send is not really anonymous... the volume ID allows me to identify the user that registered previously. Additionally I don't want to give the user the choice of sending that information or not. If the user doesn't want that, he/she can buy the paying version.I just wanted to make sure I don't do anything illegal/or not nice to the user.
Multitexturing
Graphics and GPU Programming;Programming
Ive just taken up multitexturing for terrain rendering. But I suspect I either dont understand what multitexturing is or is for...or how to use it.Basically I wanted to use it as a way to avoid slow glBindTexture calls. By loading multiple textures in and then switching between them by varying the index on the texture cords function.Looking at Nehe 22 it seems multi-textuing is perhaps for something a bit more complicated and clever than what Im trying to do.So my question first is: Am i barking up the wrong tree? Or is this indeed a way to speed up terrain rendering?Now the problem.I wrote a test program to get it going. The program currently (each frame) loads two textures in and displays either 0 or 1. This can be toggled by a key press.All works great except if the first texture co-ordinate on the Y axis is not zero (or 1.0 2.0 etc)If the co-ordinate is fractional.....then each successive key press causes textures to change and go missing.Ill post code if needed...was hoping someone might know what Ive done wrong.Does multi-texturing not allow fractional co-ordinates?Thanks for any help you can give.
Multitexturing is for blending 2 or more textures. example:http://www.lighthouse3d.com/opengl/glsl/index.php?textureMulti; are you actually running into bottlenecks with too many texture switches? are you sorting your meshes to minimize these state changes?maybe your world simply needs to reuse textures more often. atlasing textures together can help this to an extent;Quote:Original post by RDragon1are you actually running into bottlenecks with too many texture switches? are you sorting your meshes to minimize these state changes?Im anticipating a problem. The terrain doesn't support different textures yet (most of the code is in but not the switching part). However inserting a bind command to be done before each tile is very slow.Because the draw distance is ~10 miles Im sorting them by distance.Of course, thats a worse case scenario and the #switches will be far less in reality. Was hoping to speed it up by 'caching' the textures in the mutitexture units.Quote:maybe your world simply needs to reuse textures more often. atlasing textures together can help this to an extentIll look up atlasing. Thank you. EDIT. Oh right, I considered doing that...but it requires the textures be aligned to the mesh and I wanted to be able to make use of texture wrapping. However, perhaps Ill reconsider and work on making hem aligned.Quote:Multitexturing is for blending 2 or more textures. example:http://www.lighthouse3d.com/opengl/glsl/index.php?textureMultiSo no good for what Im trying to do then? Like I said, it did work and much faster...so long as I dont use a fractional co-ordinate on the Y axis.Thanks for the replies.[Edited by - empirical2 on June 25, 2009 6:07:54 AM]
easy normal mapping?
Graphics and GPU Programming;Programming
As someone who lacks experience and knowledge of advanced graphics techniques, is there relatively simple way in which I could implement some form of normal mapping into my 2d isometric opengl based game without using shaders and the like?
Before shaders came around, normal mapping was usually called "Dot3 bump mapping" - you might be able to find some info under that name.There should be a (fairly easy) way to do Dot3 using OpenGL fixed function graphics. ;Quote:Original post by ari556655As someone who lacks experience and knowledge of advanced graphics techniques, is there relatively simple way in which I could implement some form of normal mapping into my 2d isometric opengl based game without using shaders and the like?It might worth the effort to implement it using shaders anyway, as it is not all that hard: I did it a couple of years ago, and I never used OGL or DX extensively, and it was my second shader in my life, just after shadow mapping...then of course I don't know what other texturing and lighting are you using, and switching to shaders just for that might not be the best thing to do...
[dx10]big shaders ??
Graphics and GPU Programming;Programming
Hy.I have a complex mesh with normal mapping, skinning, textures ecc...What are the better solution in directx 10?create a big shader whit all the functionality or?????thanks.
I'm not sure what you're asking. A vertex shader for skinning and pixel shader with normal mapping are normal and not considered big.
[SOLVED] problem while changing windowed/fullscreen mode
Graphics and GPU Programming;Programming
Hi,I'm developing a 2d game engine with directx and cpp language.By pressing the F2 key the player can switch between fullscreen and windowed mode. I correctly use the TestCooperativeLevel and device Reset, releasing and reacquiring all textures, I obtain the switch between the two modes but i have a problem when i change the window style.The code, (inside an Update function called every window main loop) after device reset and objects reallocation is as follow:if(this->full_screen_mode){ ::SetWindowLongPtr(this->hWnd, GWL_EXstyle, 0); ::SetWindowLongPtr(this->hWnd, GWL_style, WS_EX_TOPMOST | WS_VISIBLE | WS_POPUP);}else{ ::SetWindowLongPtr(this->hWnd, GWL_EXstyle, 256); ::SetWindowLongPtr(this->hWnd, GWL_style, WS_OVERLAPPEDWINDOW);}::SetWindowPos(this->hWnd, NULL, CW_USEDEFAULT, CW_USEDEFAULT, this->Get_screen_width(),this->Get_screen_height(), SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_SHOWWINDOW);I start in windowed mode and send to a text file the GWL_style and GWL_EXstyle by using getWindowLong, the value of GWL_EXstyle is 256 as set by the initial CreateWindow winapi.After switching to full screen mode i find the correct value for GWL_style but the value 8 for GWL_EXstyle in place of 0. Then, switching to windowed mode again i find inside the logfile the GWL_style with the correct value but the GWL_EXstyle with value 264 (=256 + 8 (00001000 binary coded)) in place of 256.Why are my settings ignored by windows? A collateral effect is that after switching from the initial windowed mode to fullscreen and windowed mode again, the fps drops from 60fps to 34fps, my window remains always on top and if i press ALT-TAB my window loose focus but the other windows remains always behind it. I've tryed lots of changes without having the right result. I'm coming crazy!Thank you for your help(i'm sorry, this problem was formerly posted in the wrong section "General Programming", now i moved it into the more appropriate Directx section; i've tried to find between other posts but anyone seems to have the same problem)[Edited by - fabry on June 25, 2009 4:53:52 AM]
8 in the extended style is WS_EX_TOPMOST. That explains why your window is always on top. As for why you get a lower FPS; is the window the correct size? You'll probably have to resize the window when going to windowed mode, since you'll need to account for the window borders (Much like how you need to use AdjustWindowRectEx when you create the window).Also, this looks wrong to me:::SetWindowLongPtr(this->hWnd, GWL_style, WS_EX_TOPMOST | WS_VISIBLE | WS_POPUP);You can't mix extended and non-extended styles like that. ; Hi Steve, thank you very much for your quickly answer.mmmhhhh the size should be correct, i use the same variables, screen_width and screen_height, used inside the initialization function (the one which contains the CreateWindow). I sent the two values to the log file and seem to be ok (1024x768).I've also tryed to reduce the size of the window with ::SetWindowPos(.......,screen_width - 200, screen_height - 200,....) to see what happens but i still obtain a maximized window. Windows simply ignore the setting.Is the ::SetWindowPos ok for resizing the window? Or it must be replaced by the AdjustWindowRectEx api?I'll take a deeper look at the ::SetWindowLongPtr api documentationWhat sounds strange to me is that while toggling to windowed mode, I change the GWL_EXstyle to 256 to avoid the flag WS_EX_TOPMOST but the log reports to me that the GWL_EXstyle is still 264 so the flag i set ;Quote:Original post by fabryHi Steve, thank you very much for your quickly answer.mmmhhhh the size should be correct, i use the same variables, screen_width and screen_height, used inside the initialization function (the one which contains the CreateWindow). I sent the two values to the log file and seem to be ok (1024x768).I've also tryed to reduce the size of the window with ::SetWindowPos(.......,screen_width - 200, screen_height - 200,....) to see what happens but i still obtain a maximized window. Windows simply ignore the setting.Is the ::SetWindowPos ok for resizing the window? Or it must be replaced by the AdjustWindowRectEx api?SetWindowPos is fine; but if your window has borders (I.e. has the WS_OVERLAPPED style) you should be using AdjustWindowRectEx to determine the correct window size to use - If you pass 1024,768 to CreateWindowEx, the window is 1024x768, but the client area will be something like 1018x742 because of the size of the borders and title bar. That means that if your backbuffer is 1024x768, you don't have a 1 to 1 mapping of backbuffer pixels to window pixels, which can give you weird effects, and totally breaks picking.When you're specifying the size for the window with SetWindowPos(), you are removing the SWP_NOSIZE flag, right?Quote:Original post by fabryWhat sounds strange to me is that while toggling to windowed mode, I change the GWL_EXstyle to 256 to avoid the flag WS_EX_TOPMOST but the log reports to me that the GWL_EXstyle is still 264 so the flag i setWhy do you set it to 256? You should be using WS_EX_WINDOWEDGE or nothing at all - depending on what you want.My fullscreen toggle code is:// Change window style to remove border in fullscreen modeDWORD dwStyle;if(m_thePresentParams.Windowed)dwStyle = (WS_OVERLAPPEDWINDOW | WS_VISIBLE) & ~WS_THICKFRAME;elsedwStyle = WS_POPUP;SetWindowLongPtr(m_hWnd, GWL_STYLE, dwStyle);// Make sure the changes are flushedSetWindowPos(m_hWnd, NULL, 0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);I never touch the extended style, because my code doesn't need any extended style bits set. ; Hi Steve, I have no need in my code to change the size of the window. I have a resolution of 1024x768 and i'd like to use the same resolution as for fullscreen as for the size of the window; the size is initially set in the winmain CreateWindow and i'd like that the winodowed mode maintains the same size (borders and titlebar included). I call the SetWindowPos only for having the changes made by SetWindowLongPtr flushed.I changed my code according to your advices and now the style changing during toggle is made as you do in your engine but I always have the same problem with some important changes:1° case: start in windowed mode, 60fps, the window is 1024x768 and hides the win taskbar, it's big as the entire screen. If I press ALT-TAB another window get the focus and correctly covers my window. I ALT-TAB to gain focus again and I double-click on the titlebar of my window. At this point the win taskbar appears at the bottom of the screen cutting the bottom of my, the fps drops from 60 to 34 but ALT-TAB works, my window is covered by another window. I regain focus and i double-click again on my titlebar, my window covers the win taskbar and the frame rate come back from 34 to 60fps. I've also noticed, placing a timer that starts before the device->Present() and stops just after the device->Preset() to calculate the swap time between the front and backbuffer, that when 60fps the swap time is 13ms, when 34fps it raises to 25ms. I don't know the reason because the Presentation interval is always the same.When at 34fps the sprite objects have a jerkily movements and anyway I have a better fluid motion in windowed mode at initial 60fps than in fullscreen at 50fps.2° case: start in windowed mode at 60fps, toggle to fullscreen at 50fps and back to windowed mode again with a drop to 34fps with a swap buffers time raised from 13ms to 25ms. In this case, the window remains always on top, if I ALT-TAB the other windows stay behind my window. I formerly changed the extended style (now removed from my code) just for this reason, hoping to prevent this behaviour, unsetting the topmost flag, but as i told, it didn't work, my window was still on top. Now if I'm in windowed mode and I drag my window with one or two borders out of the screen the image starts to flicker and the flickering amount is as more as a bigger portion of the window is outside the edges of the screen (The weird effects you were talking about in your previous post?). It seems like at every frame swap, the images in the front and backbuffer are not aligned.This is what happens in details during the toggle, I used alt-tab to minimize the window and use Win Spy++ to watch the style and extended style of the window (I cut the WS_MINIMIZE flag because it's due to the alt-tab to watch the Spy++)- start in winmode with 60fps: style: 34cb 0000 (WS_CAPTION, WS_VISIBLE, WS_CLIPSIBLING, WS_SYSMENU, WS_OVERLAPPED, WS_MINIMIZEBOX, WS_MAXIMIZEBOX)ex_style: 0000 0100 (WS_EX_LEFT, WS_LTRREADING, WS_EX_RIGHTSCROLLBAR, WS_EX_WINDOWEDGE)- hit F2 to toggle to full screen mode with 50fps:style: b400 0000 (WS_POPUP, WS_VISIBLE, WS_CLIPSIBILINGS)ex_style: 0000 0008 (WS_EX_LEFT, WS_LTRREADING, WS_EX_RIGHTSCROLLBAR, WS_EX_TOPMOST)- hit F2 to come back to windowed mode, 34fps, here the problem starts:style: 34cb 0000 (WS_CAPTION, WS_VISIBLE, WS_CLIPSIBLING, WS_SYSMENU, WS_OVERLAPPED, WS_MINIMIZEBOX, WS_MAXIMIZEBOX)ex_style: 0000 0108 (WS_EX_LEFT, WS_LTRREADING, WS_EX_RIGHTSCROLLBAR, WS_EX_TOPMOST, WS_EX_WINDOWEDGE)NOTE: also without change the extended style I find the WS_EX_TOPMOST flag setI post some code hoping you could help me to understandwinmain.cpp:int WINAPI WinMain(....){MSG msg; WNDCLASSEX wc;HWND hWnd; DWORD dw_style;//RegisterClass(hInstance);wc.cbSize=sizeof(WNDCLASSEX);wc.style=CS_HREDRAW | CS_VREDRAW;wc.lpfnWndProc=(WNDPROC)WinProc;wc.cbClsExtra=0;wc.cbWndExtra=0;wc.hInstance=hInstance;wc.hIcon=NULL;wc.hCursor=LoadCursor(NULL, IDC_ARROW);wc.hbrBackground=NULL;wc.lpszMenuName=NULL;wc.lpszClassName=g_engine->GetWinTitle();wc.hIconSm=NULL;RegisterClassEx(&wc);//at the beginning g_engine->Get_full_screen_mode() returns false, we start always in windowed modeif(g_engine->Get_full_screen_mode())dw_style = WS_POPUP;elsedw_style = (WS_OVERLAPPEDWINDOW | WS_VISIBLE) & ~WS_THICKFRAME;//window creationhWnd=CreateWindow(g_engine->GetWinTitle(),//win classg_engine->GetWinTitle(),//title bardw_style,//styleCW_USEDEFAULT,//win x posCW_USEDEFAULT,//win y posg_engine->Get_screen_width(),//widthg_engine->Get_screen_height(),//heightNULL,//parent winNULL,//menuhInstance,//istanza applicazioneNULL);//win parametersif(hWnd==NULL)return 0;//display winShowWindow(hWnd, nCmdShow);UpdateWindow(hWnd);//Create an instance of Engine class called g_engine g_engine = new Engine();//Game initializationif(!g_engine->Init(hWnd))return 0;bGame_Over=false;//Message Loopwhile( !bGame_Over ){if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){TranslateMessage(&msg);DispatchMessage(&msg);}g_engine->Update();//Process game loop} //end while trueg_engine->End();//Game cleanupdelete g_engine;return msg.wParam;} //WinMain endEngine class:Engine::Engine(){..........this->deviceLost = false;this->toggling_WinFullScreenMode = false;}void Engine::Shutdown(void){bGame_Over = true;}int Engine::Init(HWND hWnd)//D3D Initialization{D3DDISPLAYMODE dm; this->hWnd = hWnd;......this->d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &dm);//this->p_d3dpp_windowedMode holds Presentation_parameters for windowed modeZeroMemory(&(this->p_d3dpp_windowedMode), sizeof(this->p_d3dpp_windowedMode));this->p_d3dpp_windowedMode.Windowed = true;this->p_d3dpp_windowedMode.SwapEffect = D3DSWAPEFFECT_DISCARD;this->p_d3dpp_windowedMode.BackBufferFormat=D3DFMT_UNKNOWN;this->p_d3dpp_windowedMode.PresentationInterval = D3DPRESENT_INTERVAL_ONE;this->p_d3dpp_windowedMode.hDeviceWindow = this->hWnd;//and this->p_d3dpp_fullScreenMode for fullscreen modeZeroMemory(&(this->p_d3dpp_fullScreenMode), sizeof(this->p_d3dpp_fullScreenMode));this->p_d3dpp_fullScreenMode.Windowed = false;this->p_d3dpp_fullScreenMode.SwapEffect = D3DSWAPEFFECT_DISCARD;this->p_d3dpp_fullScreenMode.BackBufferFormat=dm.Format;this->p_d3dpp_fullScreenMode.BackBufferCount = 1;this->p_d3dpp_fullScreenMode.BackBufferWidth = this->screen_width;this->p_d3dpp_fullScreenMode.BackBufferHeight = this->screen_height;this->p_d3dpp_fullScreenMode.PresentationInterval = D3DPRESENT_INTERVAL_ONE;this->p_d3dpp_fullScreenMode.hDeviceWindow = this->hWnd;//this->p_d3dpp holds the parameters for device->Reset and device->CreateDeviceif(this->full_screen_mode){//FULL screen mode::ShowCursor(FALSE);this->p_d3dpp = this->p_d3dpp_fullScreenMode;}elsethis->p_d3dpp = this->p_d3dpp_windowedMode;//Create device D3D devicethis->d3d->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,this->hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&this->p_d3dpp,&(this->d3ddev));if(this->d3ddev==NULL){MessageBox(NULL, "Engine::Init - Error creating D3D Device", "ERROR", MB_OK);return 0;}.... }void Engine::ToggleScreenMode(void){//function called if F2 key hit by user to toggle between windowed and fullcreen modethis->full_screen_mode = !this->full_screen_mode;this->deviceLost = true;this->toggling_WinFullScreenMode = true;if(this->full_screen_mode)this->p_d3dpp = this->p_d3dpp_fullScreenMode;elsethis->p_d3dpp = this->p_d3dpp_windowedMode;}void Engine::Update(){//Called in the window main loop at every frameHRESULT result;//Check if the device is lost (ALT-TAB in fullscreen mode) or user hits F2 for togglingif(this->deviceLost){result = this->d3ddev->TestCooperativeLevel();if(result == D3DERR_DEVICELOST){::Sleep(100);return;//leave Update method and go to the win main loop} //endif(result == D3DERR_DEVICELOST)if( (result == D3DERR_DEVICENOTRESET) || (this->toggling_WinFullScreenMode) ){//device->Reset can be tried or user hits F2 key//Release of all resources and call device->Resetthis->onLostDevice();result = this->d3ddev->Reset(&this->p_d3dpp);if(result == D3D_OK){//Reset is OKthis->deviceLost = false;//Try to reacquire all resources previously releasedif( !this->onResetDevice() ) {this->Shutdown(); //something wrong, shutdown and kill the application}if(this->toggling_WinFullScreenMode) { //if true the user press F2 for toggling modethis->toggling_WinFullScreenMode = false;DWORD dwStyle;if(this->full_screen_mode){//change style for full screen modedwStyle = WS_POPUP;::ShowCursor(FALSE);}else{//change win style for windowed modedwStyle = (WS_OVERLAPPEDWINDOW | WS_VISIBLE) & ~WS_THICKFRAME;::ShowCursor(TRUE);}//change the win style and flush changes::SetWindowLongPtr(this->hWnd, GWL_STYLE, dwStyle);::SetWindowPos(this->hWnd, NULL, 0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);} //endif(this->toggling_WinFullScreenMode)}else{ //the device->Reset goes wrong, return, leave Update method and go back to the win main loopreturn;} //endif(result == D3D_OK)}//endif(result == D3DERR_DEVICENOTRESET)if(result != D3D_OK){////something wrong, shutdown and kill the applicationthis->Shutdown();} //endif(result != D3D_OK)} //endif(this->deviceLost) --- end of section that manages the devicelost and the toggle mode //Call the extern function Game_Run() wich update 2d objects position according to the keys hit by userGame_Run();//it updates objects not managed by the Engine class but managed by the extern functions//automatically update the objects managed by the Engine class contained inside a std::list objectthis->Update2D_Entities();//Perform collision detection testing, I omitted the code//update with 60fps timing using a stopwatch of 14ms. If from the previous call the time passed is less than //14ms sleep(1) and jump the code belowif (!timedUpdate.stopwatch(14)) {Sleep(1);}else { //more than 14ms passed before last call, I can write on backbuffer and present the scene//update input devices and audio system, code omitted//Render objectsif(this->Start_Render()) //execute this->d3ddev->BeginScene();{this->d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 200), 1.0f, 0); //Clear the scenethis->Start_Render2d(); //execute D3DXSprite->Begin(D3DXSPRITE_ALPHABLEND))this->Draw2D_Entities(); //execute the D3DXSprite->Draw() for the objects managed by the Engine class contained inside a std::list objectGame_Render2d(); //extern function that does the D3DXSprite->Draw() for the objects not managed by the Engine class but managed by the extern functionsthis->Stop_Render2d(); //execute D3DXSprite->End();this->Stop_Render(); //execute the this->d3ddev->EndScene() and the this->d3ddev->Present(NULL, NULL, NULL, NULL);//if the d3ddev->Present() get back a D3DERR_DEVICELOST =====> this->deviceLost = true;}//automatically remove the dead objects managed by the Engine class and contained inside a std::list objectthis->Bury2D_Entities();} //endelse} //End of Engine::Update [Edited by - fabry on June 23, 2009 2:57:39 AM]; Hi,also tryed leaving the screen res to 1024x768 but change the game res to 800x600. I always start in win mode, toggle to fullscreen and go back to window mode: the fps is ok(60) but the window is always on top (i have no code portion for it).Also tryed to drag the window outside the screen edge. This causes some weird effects, the image flickers and the center of the image is not aligned with the bottom and the top. It doesn't happen when i first start the game but only after coming back to win mode after double toggling from the first win mode and the second full screen mode. Maybe something wrong with the backbuffer? I've tryed different solutions but without a good result.I posted the code in the previous post.I hope you can help, thanks in advance... ; What CPU, GPU and OS do you have? In windowed mode, Present() causes a BitBlt() from the backbuffer to the window client area, but only if the client area size matches the backbuffer. If the sizes differ, Present() will be forced to call StretchBlt(), which will obviously be slower - perhaps substantially.So - have you checked that the size of your client area (From GetClientRect()) is always the same as your backbuffer size? ; It's a notebook with an Intel Pentium M (centrino running at 1.7Ghz), an integrated GPU Intel 82855 GME Graphics controller running Windows XP Pro.Between the window mode at the beginning (where all is ok, fps is good, there is no flickering and no weird effects) and the window mode after double toggling, there's no change of the size of the client area and backbuffer, i always use the same variables and I restore the same win styles and d3d settings, for this reason this fact sounds so strange to me.Anyway i try to send to logfile these details and check again.Thank you ;Quote:Original post by fabryIt's a notebook with an Intel Pentium M (centrino running at 1.7Ghz), an integrated GPU Intel 82855 GME Graphics controller running Windows XP Pro.Between the window mode at the beginning (where all is ok, fps is good, there is no flickering and no weird effects) and the window mode after double toggling, there's no change of the size of the client area and backbuffer, i always use the same variables and I restore the same win styles and d3d settings, for this reason this fact sounds so strange to me.Anyway i try to send to logfile these details and check again.Thank youThat's exactly the sort of spec where I'd expect to see a difference between BitBlt and StretchBlt performance. You could also try explicitly specifying a backbuffer size for windowed mode, in case the backbuffer is being created at say 1024x768 when re-entering windowed mode, but then the window is resized to 1024x768 which will make the client area smaller than that. ;Quote:That's exactly the sort of spec where I'd expect to see a difference between BitBlt and StretchBlt performance. You could also try explicitly specifying a backbuffer size for windowed mode, in case the backbuffer is being created at say 1024x768 when re-entering windowed mode, but then the window is resized to 1024x768 which will make the client area smaller than thatGreat!!!!!! The second time i switch to win mode i have the backbuffer at 800x600 and the client area size of 794x575. Why does it happen if i use the same identical style used in CreateWindow?
Help me with stressless tactical melee combat
Game Design and Theory;Game Design
I need some advices in archiving a "stressless" melee combat. I'm developing a rpg playing in a dungeon. The games is played in a first person perspective and combat is interactive. The first person perspective has been choosen to create a greater sense of immersion.Well, my goal is to make combat less stressful to be more attractive to rpg gamers than to action gamers. A classic MMORPG uses some kind of auto combat to avoid such situation, a more action oriented game such like oblivion tends to stress the gamer more. I need an approach where the skill of the character and not of the gamer determines about the combat result, but on the other hand I want to avoid auto-combat. The player should control attacks and special abilities (tactical aspect) but hectic movement and wild button pressing should not result in an other combat outcome.Attack frequenceIn an action game, when you execute the attack you have to wait for a few seconds before starting the next attack. For optimal damage output you need to get the right attack rhythm which could alter with slower or faster weapons. My approach to avoid this is to abstract weapon statistics to a single dps(damage per second) value and to output damage independently of your attack frequency. I.e. attacking your opponent two times in a second will result only in half dps whereas if you attack just in a 2 second rhythm will result in two times damage(per hit). There will be an upper time limit of course.Movement aspectIn an action game, the player tends to move away from his opponent to avoid being hit, then rushing forward to execute his own strike. This one is harder to avoid in a satisfing way. One approach to avoid this is to use some kind of attack lag, meaning that you get hit even if you move away from your opponent, but only if you were in his attack range before. An other approach would be to execute a counter attack whenever you attack your opponent, with the dps approach from above this would result in a more movement independent damage output.Tactical aspectThe character and every monster is simulated by phyiscs, that results in quite nice tactical situation. To avoid being attack from too many opponents at once you hold your ground in a narrow hallway, but on the other hand being surrounded by enemies will most likely stop any escape attempt. But strength although plays a role.A mass of enemies pressing at you will push you away from the narrow hallway into more open ground, on the other hand you will be able to push weaker enemies away to escape. But I think this tactical approach only works if crowded melee combat doesn't result in hectic, panic button smashing. Keep calm and put some trust in your characters abilities.Is this a feasable approach ? Has is be already done in a game and succeed or failed ? What other approaches come to mind ?--Ashaman
One way to make combat less stressful is to make it that the only way to dodge/parry/block an attack is based off of player and monster stats only instead of relative positioning (assuming the monster has aggro and is in range to attack).Thus once you're in melee range of an aggressive monster, dancing around, strafing etc, will not help you avoid attacks.I'm pretty sure WoW is like this. Same with several other MMOs including LOTRO and WHO.I didn't like Oblivion because there seemed to be all sorts of dancing and positioning involved to fight effectively. It was stressful. ; My quick thoughts about combat related stressors:I am stressed if the outcome of the combat is uncertain, or if it looks like I will leave the fight with very low health and there is no or slow regen.I am stressed if I am unable to adequately engage my opponent. For me this is a combination of the following factors:- How complicated/fidgety the controls are (worse = more stressful)- What the expected reaction time for dealing with the opponent's attacks is (less time to react = more stressful)- How quickly/cleanly my character responds to my intructions (slower/stupider = more stressful)In a sense, what you propose is removing these last two stressors. The only real issue I see is that the common trope of a first person game is that you are present and your actions translate directly into the actions of your character. I'm not saying it won't work, just be prepared to break some players assumptions (ie they will be confused).You might want to look at this for some thoughts on what player agency is and whether or not you are making a mess of it.Also, I dispute your assertion that first-person perspective necessarily means a more immersive experience. I personally find them less immersive, because I identify strongly with the physical sensations of my body, so seeing one thing but feeling another breaks immersion for me. ; To be perfectly honest the combat system has a huge disconnect with the player especially in a first person view. The player sees 2 equal swings happening within two seconds and later sees 1 swing happening within 2 seconds and yet both are considered to do the same amount of damage. Trying to mix reaction and rule-based combat systems tend to make things really muddy and more often than not frustrates a player because they did something but the rules say they didn't. Now the RPG player will be frustrated even more when he catches on to what's going on behind the scenes and all he will do is frantically click the attack button to get the most optimal damage out because he doesn't want to miss a single second of time where he could be doing damage. This is why auto-attack is put in place. The player can still interrupt the auto-attack and use a skill a certain time but he should go right back to auto-attacking afterward. These players will always however be looking to get the maximum output because they don't have much real control over their characters, only certain variables in a a formula.Morrowind tried a combat system similar to what you're describing and it was absurd to see my swords and arrows pass through an enemy and not damage it a bit because my character's skill level with that weapon was too low for that monster.If you want to make combat be based solely on a character's skills and not a player's reaction and accuracy and you don't want to use an auto-combat sytem then you really can't use any real-time combat because enemies are not going to wait for you to decide what to do. If they are waiting then you don't have real-time you have turn-based combat.Combat by its very nature is stressful, people don't want to get hurt or die and they will use all their willpower to see that doesn't happen. Even turn-based combat can be stressful because you'll agonize over which is the right decision for the current setup. Even after you've made your decision you'll still be wondering if it was the right one until combat is over. If you remove tension and stress from combat it become boring. Combat is supposed to be a challenge which involves stress because there's a possibility of failure. If you get rid of that stress(such as making failure not possible) you might as well be filing papers in folders. ; @loom_weaver:Yep, that's what I mean. I play FPS (i.e. BF series) where jumping, running, strafing is just a major fun factor of the game. But in games, where I want to evolve a character, like in oblivion, it is disturbing. @Symphonic:I took a look at the other thread. There you wrote:Quote:I would break the continuum of agency down roughly so:1 - You are trying to communicate to the player that he is the character; inputs map directly to actions on the part of the character. Then 'scaring the character' really means scaring the player. Arguably the most difficult thing to do, suspension of disbelief is probably your biggest tool here... go look at Half-Life, even though it's not an RPG.2 - You are trying to communicate to the player that he controls the character's intention, but is not embodied by her (Diablo roughly represents this). Then 'scaring the character' might mean a UI element that measures fear, and as fear rises the character's responses to inputs become more sluggish, or some inputs (attack the source of the fear) are responded to with a clear 'I can't bring myself to do that' behavior.3 - You are trying to communicate to the player that he directs the character(s), so inputs are 'orders' and whether those orders are fulfilled is the game's determination, think Warcraft 3 (I know, it's an RTS, but the RPG elements closely resemble this idea). Here, 'scaring the character' is probably best represented as a debuff of some kind. The little 'fear' effect appears around the character, and she becomes unresponsive to orders, may run around randomly or attack indiscriminately.Although the topic targets in an other direction, I would say, that I want to target the first approach (direct control). Choosing the right perspective has great impact on control and perception. I choose to rise perception over control, because with a FP perspective your are able to show and hide information more accurate. Using a none FP perspective (iso/3rd person) you gain often too much visual information (you see what hides behind a door or corner) and almost no audio infomation at all (just some nice sound effects, but without much information).On the other hand , with a FP perspective you are able to hear your environment (moving mobs, creaking doors, water) which delivers important informations about resources, mob location, door activities etc. Additionally you have to get around a corner to see what hides there, whereas with an other perspective you could use some camera tricks to gain a safe preview.Quote:- What the expected reaction time for dealing with the opponent's attacks is (less time to react = more stressful)This is the major balance problem I'm trying to get right. There are turn based games with almost infinit time to make your decisions, on the other hand there are pure action games with almost no real decisions but pure reactions. I'm not willing to accept, that a FP perspective enforces an action game. With multiplayer in mind an approach like fallout 3 is not a option.Well this leaves me to add more tolerant direct interactions like auto-aiming in a shooter by - removing or easing time critical interactions, - adding aiming support (attack cone vs. accurate aiming), - adding higher tolerance in range limits.I want to support the player without destroying the FP experience. Even if I add more tolerant controls I will try to hide it. By hiding I mean that I don't want to display direct damage output. Most melee combat abilities, like swinging a weapon or a magic "close" combat spell, will target what is in front of you instead of just one single aimed opponent (=>age of conan). After all there will be abilities which will target only a single entity. In this case this abilities should not be time critical (i.e. support spells).Thinking about age of conan, that is an approach which goes into the right direction. But I want to take it a step further: less hectic, more tactic--Asahamn
Pointers to class objects
For Beginners
I was compiling some code, and the compiler told me that the following code was invalid:Foo *pFoo_1 = Foo Foo_1;I was, however, allowed to declare my object on the heap:Foo *pFoo_1 = new Foo;Why would I be able to place a pointer to a class object on the heap but not the stack as well?ooo. Is it because I wasn't assigning pFoo_1 to an address... I suppose Foo *pFoo_1 = Foo &Foo_1;would have workedSo what's your take on my conundrum here?
This line isn;t really valid:Foo *pFoo_1 = Foo Foo_1;What you want is probably:Foo Foo_1;//put an object on the stackFoo *pFoo_1 = &Foo_1;//get the address ;Quote:Original post by zoner7I suppose Foo *pFoo_1 = Foo &Foo_1;would have workedNo this is invalid syntax and should yield a compiler error as well. Hodgman has already posted how to get the adress of a variable on the stack. But just keep in mind that you are not allowed to delete this pointer and its associated memory. So it is rather dangerous and error prone to store pointes on stack variables.; What you can have is a reference to a constant Foo.Foo const& ref = Foo();Although this is completely pointless.
GLSL & Glut - windowed to fullscreen glitch
Graphics and GPU Programming;Programming
Hi, I've written a program that switches between windowed and fullscreen mode using GLUT. However, when I switch from windowed mode to fullscreen by calling glutEnterGameMode() the rendered image appears as a flat white object. For some reason the GLSL shader I have written isn't being recognised in fullscreen mode. Everything works fine in windowed mode.Has anyone else come up against this problem??My system has SLI Enabled, running two NVIDIA GeForce 8700M GT'sBelow is a code snippet from the program that switches mode:case GLUT_KEY_F1:{if(DISPLAY_FULL_SCREEN){ glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH|GLUT_ALPHA);glutGameModeString("640x480:32");// enter full screenif (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) {glutEnterGameMode();// register callbacks againinit();}}else {// return to default windowif (glutGameModeGet(GLUT_GAME_MODE_ACTIVE) != 0){glutLeaveGameMode();gSleepCounter = 10;}}}break;Any help appreciated...cheers
glutEnterGameMode creates new window with new GL rendering context, so you need to reload any shaders, textures, etc. after that happens ; cheers snoutmate,All working now.
[Help] create a ray and detection
General and Gameplay Programming;Programming
Hi guys, i have loaded a mesh and it spin on the screen but now i would like to create a ray to detect if the ray is hit on mesh or not how should i do it? What are the stage should i do?
Let's keep this in one thread shall we?
2D/3D game programming language
General and Gameplay Programming;Programming
Hey guysI've been wanting to write a compiler for my portfolio for a while now. The best idea I could think of for a my next project, was making simple language/compiler for begginer programers, to code games. A programming language made specifically for game developement and writting quick graphics scenes.I wanted a lot of opinions on it. Like whether people would be interested in using it, or would they just prefer to learn an all purpose language such as C/C++ etc.I know it has been done before, but I'm sure they missed out a lot of things. Does anyone have any feature suggestions on any ideas on how it would be more suitable to a user. If you where a use what would you want from it ect? Either specific features or general ideas. What sort of trade off between power and simplicity etc.Any other thoughts would be helpfulThanks yousilver
In my opinion it's better to learn a language like C++.But a compiler that can deal with all the things you need for games (integrated shader-language compiler, 3D-model viewer, etc.) would be useful. ; Yea, a lot of people who just want to code games spend a lot of time learning other stuff they don't need to know if they just want to make games. They got to learn c++ then they gota learn opengl, and then they gota learn a windowing API and all the other stuff needed for games. Having it all integrated into one language could save a lot of time. ; Personally, there are so many options available now for quick prototyping that I probably wouldn't be interested in learning yet another language. Java, C#(XNA), Flash, Python, and the many libraries available for them, just to name a few.For beginners who want to get something done quickly, there are also options that include map editors, resource editors, WYSIWYG environments, etc., such as Gamemaker, that aren't necessarily built around a language. These may appeal more to beginners, although they tend to be domain-specific.How game/genre specific do you want to get? Are you targeting toward the absolute beginners, who don't want to spend a lot of time learning how to program or make graphic assets? Or are you looking to explore novel language syntax/usage characteristics that might appeal to intermediate programmers? Are you going to compile to machine code? If so, is portability a concern?This is probably not what you are going for, but I always thought it would be interesting to implement an interactive fiction language, along the lines of TADS or HUGO.Hmmm... what about a language that has inherent support for 2d/3d objects, vectors, physics, collision, etc.? Probably a lot of work, but if only 2d you could wrap something like Box2d. ; Excellent post laztrezort.The first project would be in 2D. But first prototyping all the basics of the language first.The original idea I had was to create a simple language that had inherent support for display, 2d/3d objects, vectors, physics, collision, etc. My first step would have just been to do the front end of the compiler first, (converting the language into an IR) and worring about the rest later. But this would require a lot of low level work on graphics and stuff, I wouldn't be able to use opengl etc.So I thought it would be smarter to make a language and a compiler which can utilise and intergrate all the different aspects of game developement, with the power of C++. When I was doing my A-Levels (before university) I wanted to make some games, and I wasted so much time just trying to get a programming language to work with a graphics API like opengl and a windowing language/GUI API like wxWidgets and an IDE. And then so much rewritting of basic game code for simple stuff like collisions etc.I hadn't heard of Box2D before, but from a quick google of it, it looks perfect for such a project. I am going to look into it.Thank youQuote:Original post by laztrezortPersonally, there are so many options available now for quick prototyping that I probably wouldn't be interested in learning yet another language. Java, C#(XNA), Flash, Python, and the many libraries available for them, just to name a few.For beginners who want to get something done quickly, there are also options that include map editors, resource editors, WYSIWYG environments, etc., such as Gamemaker, that aren't necessarily built around a language. These may appeal more to beginners, although they tend to be domain-specific.How game/genre specific do you want to get? Are you targeting toward the absolute beginners, who don't want to spend a lot of time learning how to program or make graphic assets? Or are you looking to explore novel language syntax/usage characteristics that might appeal to intermediate programmers? Are you going to compile to machine code? If so, is portability a concern?This is probably not what you are going for, but I always thought it would be interesting to implement an interactive fiction language, along the lines of TADS or HUGO.Hmmm... what about a language that has inherent support for 2d/3d objects, vectors, physics, collision, etc.? Probably a lot of work, but if only 2d you could wrap something like Box2d.; Making game development easier would require more than just a language. ; It wouldn't just be a language. It would intergrate everything required to make a game. Without having to spend time linking external libraries yourself.Quote:Original post by ZahlmanMaking game development easier would require more than just a language.; While I'll concede with laztrezort that there'll likely be plenty of people who'd want to stick with the current languages they know, you mentioned this was for beginners(who'd have no prior experience in /anything/) and you wanted to do this anyway, so there is likely no stopping you. [wink]Now, I don't know what experience you have, so if you've written interpreters before, you can just ignore this. If you haven't written interpreters before, I'd suggest going with that first. For the purposes of your target audience, beginners, it likely wouldn't matter a whole lot if it is compiled or interpreted. I'm over 90% confident that even GameMaker itself doesn't compile the game, just throws all the data as resources or somesuch into an already compiled file containing the 'engine'. (Not sure how accurate that last statement is, as it is only from personal observations some time ago.) So unless you're ready for the problems most definately to be had by writing a compiler for a modern machine (I presume you're not going to be writing the compiler for an older machine that'd likely turn out to be an emulator?), I'd say go for the interpreter bit.As for the language, I'd argue it'd be best similiar to something along the lines of C#(or Java/Basic, I'm just partial to C# right now[grin]), with graphics based keywords thrown in. i.e., instead using a whileloop and checking against current clock time and last recorded clock time for fps, have something like gameloop 30 fps{/*code*/} or somesuch. Other keywords might be draw [image], etc.By an chance, though, is what you're wanting to make something like this, just for beginners? If so, you may want to have additional GUI elements for beginners to enter maths/data in a more beginner intuitive manner, then pop the code for them wherever the cursor was at, kind like, again, GameMaker.[Edit]Found it!Quote:You should note that Game Maker "disassembly" is not true disassembly. It is resource extraction.That pretty much seems to be inline with what I was saying earlier about it. [grin] ; I'm working on something kind of similar, so I can share a lot of thoughts:At the basic level, if you do nothing other than take care of all the window initialization, and you give the user access to high-level functions like "load_image", "draw_image", "is_key_pressed", then you're already making the user's life much easier. This is basically what love2d and Processing do. Those projects aren't about creating new languages though, Love uses Lua and Processing uses something like Java.Then if you want to talk about changing the language to help you, then I think there's a lot of opportunities to improve on C++. Some ideas: - When drawing, you often have to specify colors. So in Circa there is special syntax for colors, you can write #aab or #ff00ff. (Like in CSS) - Writing code to control multiple entities (like enemies) at once is hard. Having coroutine support (like Stackless Python or Lua) really goes a long way to making this easier, because you can write separate "threads", but not have to worry about most of the problems related to threading. This would be a great feature for a game language. - Along the same lines, I think the Actor model (see Erlang, Smalltalk) is a really good fit for games, but there aren't many game-appropriate languages that support this. - Also on the subject of time-based code, check out ">Urbi, which provides a bunch of language primitives for writing concurrent actions. Another interesting one from a syntax perspective is Chuck. - Being able to reload scripts on the fly is really nice for experimentation. There are different levels of how good your support for this can be. In Circa, I'm trying to do a really good job of this. - Visual editing of code is something that many people find fun, you might consider going down that road. Check out vvvv and Squeak. - One thing sorely missing in C++ is a way to do to introspection of data types. So, features like data serialization, synchronizing data over a network, or writing a run-time object browser, are annoying in C++. So in terms of ways that you can improve on C++, there is some low-hanging fruit. ; Hi guys, i'm gonna be completely honest, this is my 1st post, i registered right after reading this and i have to say, all these languages you guys are throwing out here, make completely no sense to me... yet of course. I finish high school about a month ago and quite frankly i'm bored as heck playing game after game. I had a passion since i played the Sims 3000 back in the day, and completely fell in love with amazement of how games can be made and have involved. I been spending my time still playing FPS games but i recently started reading an e-book called C++ Primer 4th Edition 2005, but it was just... really words that were hard to process with no prior knowledge of this language. Then i tried another book called C++ for Dummies, 5th edition 2004 and made my 1st app from the guide to convert Celsius into Fahrenheit, and i was blown, complete amazement, i'm about 40 pages of it in but still kinda difficult to remember whats happening. The point was, after reading this topic it would help if learning the necessary programs/languages in building a simple game that can possibly lead to better quality games, however they involve in this language barrier, like Si1ver said, people waste lots of time reading the wrong language or learning something else then needed, i personally don't wanna run into that problem. So yea, i guess you can say this is kinda me introduction about me and at the same time saying, hope to hear about your future program S1lver. And if anyone can suggest what i'm suppose to actually read and learn so i can have a foot down into making games, that would be useful, thanks in advance.
How long does it take you to finish a tutorial?
GDNet Lounge;Community
I have been looking in to some online tutorials namely win32,python etc. My main problem is that since i am studying them myself, i don't know how much time i should allot each one of them? or each module within one tutorial? What i mean is, I can finish reading the whole thing in one day but then i would not have learned it properly nor would i have had time to practice the stuff myself.On the other hand,if i keep on studying only one thing for, say 3-4 months, then i would have wasted some of my time which could have been utilized learning other things.What i am looking for is that sweet spot where you don't feel like you are wasting your time in repeating stuff and also you feel that you have learned enough about that particular tutorial.I know some of you will say that you should move forward only when you have completely understood the current module but what if i am stuck on something that need not be of much importance in the practical sense?In that case wouldn't it be wise to move forward and then comeback to the spot and re-learn it,only if needed?So i am asking the guys who have learned one thing or the other from online tutorials that how much time did you give yourself while learning the basics?
I'm 100% self taught programmer (dropout from school at 16) and now working in the field professionally for 9month already got a raise , an exceptional prime and awaiting a promotion in 4 month , now that i'm done with the self bragging i'd like to point that i felt it was necessary to show i had a "sucessfull" self learning experience before i talked about it.Programming started as a very hobby like interest to wich i dedicated nearly no time , read a bit about C++ here & there and win 32 tutorials , was always confused about all the setting up you had to do and got told to learn by heart. Overall i found i totally wasted my time with all the tutorials i've read and everything worthy i've read i've read in books. Now i find a use for tutorials , if i want to get the basics in a new language i'll pick up a good tutorial and go from there and eventually pick up a book afterward but it works now ONLY because i'm already a decent programmer , if i started from scratch i'd recommand myself AGAINST the very tutorials i find somewhat decent today.Now as for a way to allocate time i'd say it's tackling the problem the wrong way. In programming you usually start at a certain (low) level of abstraction and climb up to the high skies... but tutorials don't get you there. Why does it matter? Because the issue isn't one of 1 day or 3month , the issue is that time time to read and understand (for you ,seemingly , 1 day) is fine, but will never get you anywhere if you don't have anything to read past it to solidify what you've learnt. To get my point across take math as an example wich is very linear at it's beggining: First you learn addition , i guess you could forget how it works , however once you get to multiplication and understand that multiplication is just a chain of additions, how could you ever forget how to add? Programming is about the same , everything highter up in abstraction has the lower level as roots so you don't need to learn the basics forever , understand them and go further IMMEDIATELY , you will not forget them as long as you understand the things further , because those things still depend on the basics.With that said if you want to get good at programming do understand that once you get into books you will realise that there is quite a lot more to learn than the glimpse you've got from a few tutorials , however if you can afford them i still suggest you take that path as you will learn (from my experience) much more in the same amount of time. ; thanks for the reply ranakor,so to sum up, what you are saying is, I should focus more on books rather than tutorials?Well I already know some JAVA and C/Cpp which i have learned in school through books only.Now i am looking to learn the stuff which was not taught in school to me.I have a basic idea of OOP and other similar programming practices.So its not like i am starting right from scratch.;Quote:Original post by vrdthanks for the reply ranakor,so to sum up, what you are saying is, I should focus more on books rather than tutorials?Well I already know some JAVA and C/Cpp which i have learned in school through books only.Now i am looking to learn the stuff which was not taught in school to me.I have a basic idea of OOP and other similar programming practices.So its not like i am starting right from scratch.IMO, there are a lot of poorly written tutorials out there. Along with that, there are many different learning styles, and most tutorials cater to a specific style.I've always felt the best way to make sure you understand a concept is to be able to a)duplicate it on your own, through the application of the concept (writing a program that uses what the tutorial was about), and b)spit out that information into a coherent form for the next generation.It may seem somewhat time-intensive, if you're worried about spending too much time on one topic before moving on this may not seem like a good approach. However, I would say that solidly learning a topic the first time will take less time than relearning it later, and by writing tutorials of your own afterward you will have something to show for it.; If you want to know if you can move on from a tutorial, try testing yourself. I used to try to expand the tutorial in some way or re-organise the code in a significant way (putting it into classes, for example).Tutorials have a nasty habit of being code dumps rather than something that develops concepts. Because of this, the code used is one of the few things you can latch on to. The result is people tend to think "I can't code this from memory, so I must not know it". ; Being able to explain something to someone else is a good way to be sure you know it yourself. But I don't agree with the idea of writing tutorials on everything once you feel comfortable. The web is full of a unspectacular tutorials on all the common things, unless you're actually skilled at writing teaching all you're going to do is make the excellent resources harder to find. ;Quote:Original post by vrdthanks for the reply ranakor,so to sum up, what you are saying is, I should focus more on books rather than tutorials?Well I already know some JAVA and C/Cpp which i have learned in school through books only.Now i am looking to learn the stuff which was not taught in school to me.I have a basic idea of OOP and other similar programming practices.So its not like i am starting right from scratch.What i was saying is that , you will not find a whole lot of tutorials that can match the good books in contents , and contents if what you're lacking.If you imagine programming as a virtual ladder of 1000 steps to climb and that it is a linear path with step 2 requiring perfect knowledge of step 1 to be understood (i'm exagerating there) then a set of tutorial going to step 5 will never make things well fixed in your brain, however a book going to step 1000 will because you will not even be able to read past if you don't get what is before , and the things on wich you probably struggle throught now are only the start of a good book , hence if you had such a book you could just read untill you stop understanding what you read (not stoping wondering if you have spent enought time before , as long as you understand , it's ok) and then as soon as it becomes kinda muddy , you could go back as far as needed to get back in the clear and go back to reading.Note that unless you pick good books you will be exposed to the same issues as bad books will be like bad tutorials , however books at least get quite a lot of reviews and get you far enought to make the basics stable in your head. If you feel like taking the C# road i'd be most glad to suggest a few books i've found really good. ; I don't think its a good idea to just go around and blindly "do tutorials" to "learn." I think its better to set a goal for yourself - "make a tetris clone" and then when you come across something you don't understand how to accomplish, use books, the internet, and tutorials to help you solve the problem.If you are learning the basic basics, it might be helpful to do a couple basic intro tutorials for C++ or whatever language you are using. Then start with simple goals - "guess the number" games, and move from there. ; I eschew tutorials completely. They are too frequently written by people who either A) were learning the system they are writing about *as* they were writing about it, or B) wrote the tutorial only shortly after learning about the system. At best, they fail to demonstrate the full range of proper use, showing only a basic form of use that is often not appropriate in all cases. At worst, they are downright factually inaccurate.I had a graphics programming class in college where we were tasked with writing a basic software rasterizer. The professor suggested we look up the rotation matrix online, which everyone did. I eventually had to run a tutoring session to walk everyone through deriving the rotation matrix, because every tutorial everyone had found had been wrong.Official product reference documentation is my only choice. Want to know the semantics of C#'s try/catch/finally blocks? Read the language specification and find out the final answer to the subject. Want to know the full range of parameters to glEnable? Look it up in the OpenGL spec, and at the same time you might stumble on possible errors it can generate. You're risking too much misinformation looking it up in a tutorial somewhere. ; I agree with capn_midnight.I prefer to learn from book, and make sure that the author know what they are talking about from their background, and check for comments from amazon and other book review sites.But tutorial still have it places - usually to learn about something specific.For example I would learn C/C++ or Python from books, but I would learn how to append data into .exe to make demos (oldskoll dos days) from tutorials.I finished a tutorial in short time, as usually I study it to learn certain bit and pieces.
SDL_gfx - rotozoomSurface problems
Engines and Middleware;Programming
Hello all, [smile]I just got SDL_gfx working. The sole reason I downloaded it was so that I have a function for rotating an SDL_Surface [at runtime]. However, rotozoomSurface seems to have one problem: when I rotate a surface, the whole surface "moves" instead of only rotating in the centre.I am using the following code for rotation:cursorSurface = rotozoomSurface(cursorSurface, 10, 1.0, 1); Anyone know how to fix this problem? Sorry if this is a silly/obvious question, but then again I am new to SDL_gfx. Btw, is it just me or is the documentation serisouly lacking? I didn't find a single mention of this problem anywhere in the docs...Thanks in advance for any help you offer!
The problem here is that you are "overwriting" the the original surface with the modified surface. Create a separate surface to store the result of the rotozoom operation:...SDL_Surface *extraSurface;...extraSurface = rotozoomSurface(originalSurface, <parameters>);...But, IIRC, rotozoom creates a new surface. It's a good idea to check it out before calling this every loop.If the docs aren't as good as you want, you might want to check the code, it isn't that big anyway.Edit: The documentation explicitely says rotozoomSurface creates a new texture, so it's better if you create all the surfaces you need before using them, or at least remeber to call SDL_FreeSurface before reapplying the procedure.Edit2: Note also: Whenever you rotate the texture, the size of the surface changes. SDL_Surfaces are stored as quads. If you rotate them, their size will grow to accomodade the new one, much like this:Original After rotation*-------**------*| || / \ || || / \|*-------*| \ / | *--\/--*(The above "drawing" is, roughly, horrible. But I hope you get the idea)You have to take this into account if you want your rotated surface to be in the same place as the original was.[Edited by - fcoelho on June 24, 2009 11:29:12 AM]; The reason for the apparent movement is simple.Pick up something rectangular on your desk. Put it in front of you. Now rotate the object around. In your mind, draw a bigger rectangle around the rotated object.Using rotozoom with a surface is similar. As you rotate it around, it needs a bigger "surface rectangle" to fit the rotated image.To avoid the movement, you need to draw rotated surfaces from some point like the middle. Here is a sample routine:void blit(SDL_Surface *surface, int x, int y, SDL_Surface *dest){ SDL_Rect rect = { x + surface->w / 2, y + surface->h / 2}; SDL_BlitSurface(surface, 0, dest, &rect);}As fcoelho pointed out, you are overwriting your loaded surface. This is a bad idea, as rotating a surface is a lossy function. While calling rotozoom once will be acceptable due to the smoothing, calling it successively on a surface will degrade the quality.You need to keep your original surface, and always rotate that one. Another sample:class RotatingSurface{public: RotatingSurface(SDL_Surface *original) : original(original), rotated(0), rotation(0), invalid(true) { } ~RotatingSurface(); void rotate(float amount) { rotation += amount; invalid = true; } void blit(int x, int y, SDL_Surface *dest) { if(invalid) { if(rotated) { SDL_FreeSurface(rotated); } rotated = rotozoomSurface(original, rotation, 1, 1); if(!rotated) { // error handling ... } } blit(rotated, x, y, dest); }private: SDL_Surface *original, *rotated; float rotation; // if true, it means we must call rotozoomSurface with the new rotation value bool invalid; };Rotation in regular SDL is a slow software process. If you need to have lots of rotating images, maybe OpenGL (or a wrapper thereof) would suit you better. ; Thank you guys very much for the help! [smile]I see what I am doing wrong. Guess I am too used to how Flash handles rotation. (Although flash may lag a lot, it can easily rotate images of most sizes).Thanks again! ; Ok, SDL_gfx rotation works nicely. However, the middle point of my cursor always moves around a few pixels after the rotation (Seems to be whenever the rotation is in the middle of 0 and 90 degrees (or a multiple thereof (eg 90 and 180)). Anyone know how to get the rotation to be almost perfectly centered instead of being of 3-5 pixels? I tried rip-off's way, however that had no effect (that was basically how I was applying my surfaces in the first place)Thanks again, your help is really appreciated.EDIT: Sorry for all the troubles, I didn't realize the simple answer here. Fixed it now, and for anyone who has teh same problem on here, I did the following:My cursor is like a crosshair, 32x32 pixels wide. I always took away 16 pixels on the width & height blit so the middle of the crosshair is on the cursor hotspot. Now, when I rotated the surface, I did not in fact take into account that the surface resizes (although it has been mentioned in this thread, sorry). I kept taking away 16 pixels to get the "midddle" position. So in short, the fix was basically like this:Before:myBlitFunction(rotatedCursorSurface, screen, XMouse-16, YMouse-16);( params: myBlitFunction(SDL_Surface *source, SDL_Surface *destination, XPos, YPos); )After:myBlitFunction(rotatedCursorSurface, screen, XMouse-(rotatedCursorSurface->w/2), YMouse-(rotatedCursorSurface->h/2));Thanks again for all your help guys, O am so happy all is working now! [smile][Edited by - pseudobot on June 25, 2009 4:15:11 AM]
trying to draw the vertex buffer line
Graphics and GPU Programming;Programming
alot of code i know but i have been trying to learn index buffer and vertexbuffer and now i want to draw those points of the mesh with a LINELIST, do you guys see anything wrong because the line is apearing to the left of the screen.thanks for reading#include <windows.h>#include <windowsx.h>#include <d3d9.h>#include <d3dx9.h>#include <stdio.h>// define the screen resolution and keyboard macros#define SCREEN_WIDTH 800#define SCREEN_HEIGHT 600#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)#define KEY_UP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)// include the Direct3D Library files#pragma comment (lib, "d3d9.lib")#pragma comment (lib, "d3dx9.lib")// global declarationsLPDIRECT3D9 d3d;LPDIRECT3DDEVICE9 d3ddev;LPD3DXMESH meshTeapot; // define the mesh pointerLPDIRECT3DVERTEXBUFFER9 v_buffer = NULL;//LPDIRECT3DVERTEXBUFFER9 v_buffer = NULL;//LPDIRECT3DINDEXBUFFER9 i_buffer = NULL;//LPDIRECT3DTEXTURE9 texture = NULL;struct CUSTOMVERTEX {FLOAT X, Y, Z, RHW; DWORD COLOR;};#define CUSTOMFVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)// function prototypesvoid initD3D(HWND hWnd);void render_frame(void);void cleanD3D(void);void init_graphics(void);void init_light(void);DWORD LockThread(LPVOID param);void BuildLine();//struct CUSTOMVERTEX {FLOAT X, Y, Z; D3DVECTOR NORMAL; FLOAT U, V;};//#define CUSTOMFVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1)D3DXVECTOR3 GlobalVerticesv0;D3DXVECTOR3 GlobalVerticesv1;// the WindowProc function prototypeLRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);// the entry point for any Windows programint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ HWND hWnd; WNDCLASSEX wc; ZeroMemory(&wc, sizeof(WNDCLASSEX)); wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WindowProc; wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.lpszClassName = "WindowClass"; RegisterClassEx(&wc); hWnd = CreateWindowEx(NULL, "WindowClass", "Our Direct3D Program", WS_OVERLAPPEDWINDOW, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); // set up and initialize Direct3D initD3D(hWnd);CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)LockThread,NULL,0,0); // enter the main loop: MSG msg; while(TRUE) { while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } if(msg.message == WM_QUIT) break; render_frame(); if(KEY_DOWN(VK_ESCAPE)) PostMessage(hWnd, WM_DESTROY, 0, 0); } // clean up DirectX and COM cleanD3D(); return msg.wParam;}// this is the main message handler for the programLRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ switch(message) { case WM_DESTROY: { PostQuitMessage(0); return 0; } break; } return DefWindowProc (hWnd, message, wParam, lParam);}// this function initializes and prepares Direct3D for usevoid initD3D(HWND hWnd){ d3d = Direct3DCreate9(D3D_SDK_VERSION); D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = hWnd; d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8; d3dpp.BackBufferWidth = SCREEN_WIDTH; d3dpp.BackBufferHeight = SCREEN_HEIGHT; d3dpp.EnableAutoDepthStencil = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; // create a device class using this information and the info from the d3dpp stuct d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev); init_graphics(); init_light(); d3ddev->SetRenderState(D3DRS_ZENABLE, TRUE); d3ddev->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(50, 50, 50)); d3ddev->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 8); // anisotropic level d3ddev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC); // minification d3ddev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); // magnification d3ddev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // mipmap}// this is the function used to render a single framevoid render_frame(void){ d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); d3ddev->Clear(0, NULL, D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); d3ddev->BeginScene(); // select which vertex format we are using //d3ddev->SetFVF(CUSTOMFVF); // set the view transform D3DXMATRIX matView; D3DXMatrixLookAtLH(&matView, &D3DXVECTOR3 (0.0f, 2.0f, 6.0f), // the camera position &D3DXVECTOR3 (0.0f, 0.0f, 0.0f), // the look-at position &D3DXVECTOR3 (0.0f, 1.0f, 0.0f)); // the up direction d3ddev->SetTransform(D3DTS_VIEW, &matView); // set the projection transform D3DXMATRIX matProjection; D3DXMatrixPerspectiveFovLH(&matProjection, D3DXToRadian(45), (FLOAT)SCREEN_WIDTH / (FLOAT)SCREEN_HEIGHT, 1.0f, // the near view-plane 100.0f); // the far view-plane d3ddev->SetTransform(D3DTS_PROJECTION, &matProjection); // set the world transform static float index = 0.0f; index+=0.03f; D3DXMATRIX matRotateY; D3DXMatrixRotationY(&matRotateY, index); //d3ddev->SetTransform(D3DTS_WORLD, &(matRotateY)); // select the vertex and index buffers to use //d3ddev->SetStreamSource(0, v_buffer, 0, sizeof(CUSTOMVERTEX)); //d3ddev->SetIndices(i_buffer); // set the texture //d3ddev->SetTexture(0, texture); BuildLine();// select which vertex format we are using d3ddev->SetFVF(CUSTOMFVF); // select the vertex buffer to display d3ddev->SetStreamSource(0, v_buffer, 0, sizeof(CUSTOMVERTEX)); // copy the vertex buffer to the back buffer //d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1); d3ddev->DrawPrimitive(D3DPT_LINELIST, 0, 1); // draw the teapot meshTeapot->DrawSubset(0); //d3ddev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 24, 0, 12);d3ddev->EndScene();d3ddev->Present(NULL, NULL, NULL, NULL);}// this is the function that cleans up Direct3D and COMvoid cleanD3D(void){ //v_buffer->Release(); //i_buffer->Release(); //texture->Release(); meshTeapot->Release(); d3ddev->Release(); d3d->Release();}// this is the function that puts the 3D models into video RAMvoid init_graphics(void){ // deleted all the cube code from here D3DXCreateTeapot(d3ddev, &meshTeapot, NULL); // create the teapot}// this is the function that sets up the lights and materialsvoid init_light(void){ D3DLIGHT9 light; // create the light struct D3DMATERIAL9 material; // create the material struct ZeroMemory(&light, sizeof(light)); // clear out the light struct for use light.Type = D3DLIGHT_DIRECTIONAL; // make the light type 'directional light' light.Diffuse = D3DXCOLOR(0.5f, 0.5f, 0.5f, 1.0f); // set the light's color light.Direction = D3DXVECTOR3(-1.0f, -0.3f, -1.0f); d3ddev->SetLight(0, &light); // send the light struct properties to light #0 d3ddev->LightEnable(0, TRUE); // turn on light #0 ZeroMemory(&material, sizeof(D3DMATERIAL9)); // clear out the struct for use material.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f); // set diffuse color to white material.Ambient = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f); // set ambient color to white d3ddev->SetMaterial(&material); // set the globably-used material to &material}DWORD LockThread(LPVOID param){AllocConsole();HANDLE Console;Console = GetStdHandle(STD_OUTPUT_HANDLE);//MessageBox(NULL,"LockThread","",0);HRESULT Result;BYTE* lpbVb;BYTE *lpIB;LPDIRECT3DINDEXBUFFER9 lpIndexBuffer;D3DINDEXBUFFER_DESC ibdesc;int numIndices;DWORD numBytesPerVertex;char Buffer[64];DWORD idxVbVert0, idxVbVert1, idxVbVert2;DWORD Written;Start:Result = meshTeapot->LockVertexBuffer(D3DLOCK_READONLY, (VOID**)&lpbVb);if(FAILED(Result)){//MessageBox(NULL,"Failed to Lock Vertex Buffer","",0);sprintf(Buffer,"%s\n","Failed to Lock Vertex Buffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}else{//MessageBox(NULL,"Locked Vertex Buffer","",0);sprintf(Buffer,"%s\n","Locked Vertex Buffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}Result = meshTeapot->LockIndexBuffer ( D3DLOCK_READONLY, (VOID**)&lpIB);if(FAILED(Result)){//MessageBox(NULL,"Failed to Lock Index Buffer","",0);sprintf(Buffer,"%s\n","Failed to Lock Index Buffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}else{//MessageBox(NULL,"Locked Index Buffer","",0);sprintf(Buffer,"%s\n","Locked Index Buffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}Result = meshTeapot->GetIndexBuffer( &lpIndexBuffer );if(FAILED(Result)){//MessageBox(NULL,"Failed to get IndexBuffer","",0);sprintf(Buffer,"%s\n","Failed to get IndexBuffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}else{//MessageBox(NULL,"Got IndexBuffer","",0);sprintf(Buffer,"%s\n","Got IndexBuffer");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}Result = lpIndexBuffer->GetDesc( &ibdesc );if(FAILED(Result)){//MessageBox(NULL,"Failed to get Desc","",0);sprintf(Buffer,"%s\n","Failed to get Desc");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}else{//MessageBox(NULL,"Got Desc","",0);sprintf(Buffer,"%s\n","Got Desc");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}if(ibdesc.Format == D3DFMT_INDEX32){//MessageBox(NULL,"ibdesc.Format 32","",0);numIndices = ibdesc.Size / sizeof(DWORD);sprintf(Buffer,"%s\n","ibdesc.Format 32");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0); }else{//MessageBox(NULL,"ibdesc.Format 16","",0);numIndices = ibdesc.Size / sizeof(WORD);sprintf(Buffer,"%s\n","ibdesc.Format 16");WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}numBytesPerVertex = meshTeapot->GetNumBytesPerVertex(); sprintf(Buffer,"%s %d\n","numBytesPerVertex",numBytesPerVertex);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0); //sprintf(Buffer,"%d\n",numBytesPerVertex); //MessageBox(NULL,Buffer,"numBytesPerVertex",0); sprintf(Buffer,"%s %d\n","numIndices",numIndices);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);for(int i=0; i<numIndices; i += 3 ){if (ibdesc.Format == D3DFMT_INDEX32 ){//32 bit idxVbVert0 = ((DWORD*)lpIB);idxVbVert1 = ((DWORD*)lpIB)[ i+1 ];idxVbVert2 = ((DWORD*)lpIB)[ i+2 ];sprintf(Buffer,"%s %d\n","idxVbVert0",numIndices); WriteConsole(Console,Buffer,strlen(Buffer),&Written,0); }else{ //16 bitidxVbVert0 = ((WORD*)lpIB);idxVbVert1 = ((WORD*)lpIB)[ i+1 ];idxVbVert2 = ((WORD*)lpIB)[ i+2 ];//sprintf(Buffer,"%s %d\n","idxVbVert0",idxVbVert0); //WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);//sprintf(Buffer,"%s %d\n","idxVbVert1",idxVbVert1); //WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);}D3DXVECTOR3 v0 = *(D3DXVECTOR3*) &lpbVb[ idxVbVert0 * numBytesPerVertex ]; D3DXVECTOR3 v1 = *(D3DXVECTOR3*) &lpbVb[ idxVbVert1 * numBytesPerVertex ];D3DXVECTOR3 v2 = *(D3DXVECTOR3*) &lpbVb[ idxVbVert2 * numBytesPerVertex ];sprintf(Buffer,"%s %f %f %f\n","v0",v0.x,v0.y,v0.z);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);sprintf(Buffer,"%s %f %f %f\n","v1",v1.x,v1.y,v1.z);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);sprintf(Buffer,"%s %f %f %f\n","v2",v2.x,v2.y,v2.z);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0);GlobalVerticesv0 = v0;GlobalVerticesv1 = v1;sprintf(Buffer,"%s %f %f %f \n","GlobalVerticesv0",GlobalVerticesv0.x,GlobalVerticesv0.y,GlobalVerticesv0.z);WriteConsole(Console,Buffer,strlen(Buffer),&Written,0); //MessageBox(NULL,Buffer,"GlobalVertices",0);Sleep(50);}meshTeapot-&gt;UnlockVertexBuffer();meshTeapot-&gt;UnlockVertexBuffer();goto Start;return 0;}void BuildLine(){CUSTOMVERTEX vertices[] = {/*//triangle{ 320.0f, 50.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0, 0, 255), }, { 520.0f, 400.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0, 255, 0), }, { 120.0f, 400.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(255, 0, 0), },*///{GlobalVerticesv0.x,GlobalVerticesv0.y,GlobalVerticesv0.z,1.0f,D3DCOLOR_XRGB(0, 0, 255), }, { 0.0f, 50.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0, 255, 0), },{GlobalVerticesv1.x,GlobalVerticesv1.y,GlobalVerticesv1.z, 1.0f, D3DCOLOR_XRGB(0, 0, 255), }, //{ 0.0f, 50.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0, 255, 0), }, //{ 150.0f, 500.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(255, 0, 0), }, }; // create a vertex buffer interface called v_buffer d3ddev-&gt;CreateVertexBuffer(3*sizeof(CUSTOMVERTEX), 0, CUSTOMFVF, D3DPOOL_MANAGED, &v_buffer, NULL); VOID* pVoid; // a void pointer // lock v_buffer and load the vertices into it v_buffer-&gt;Lock(0, 0, (void**)&pVoid, 0); memcpy(pVoid, vertices, sizeof(vertices)); v_buffer-&gt;Unlock();}</pre>
There's many, many things wrong there. This is why DirectXTutorial.com is a bad idea.Let's go over them quickly...1. In your CreateThread call, you're casting a function pointer. never do that.2. If you get WM_QUIT and another message in one tick, you'll not notice the WM_QUIT message and your app will never exit.3. PostMessage(hWnd, WM_DESTROY, 0, 0) is not how you destroy a window - that's how you get undefined behaviour. You want DestroyWindow().4. You're not checking the return values for any functions. If something fails, you'll just crash.5. You're not checking if the device supports a 16-bit depth buffer or a 32-bit backbuffer.6. You're not checking if the device can support a 16-bit depth buffer with a 32-bit backbuffer (Some NVidia cards can't).7. You're setting up lighting, but you're using transformed vertices, so the light settings are ignored.8. You're setting up a world matrix, but you're using transformed vertices, so the transform settings are ignored.9. You're setting a texture, but your vertex format doesn't have texture coordinates, so the vertices will take up the colour of the top left texel in the texture.10. You're locking a vertex buffer in another thread, but not specifying D3DCREATE_MULTITHREADED when you create the device - more undefined behaviour. Using multiple threads with D3D is an extremely bad idea anyway.11. For your own sanity, as well as others who read your code - please get rid of the goto. Use while(true) or for(;;) if you need an infinite loop.From what I can tell, your code should be drawing a teapot and a line from (320, 50) to (520, 400). Although because of the multithreaded use of the device without the multithreaded flag, all bets are off as to what's going on. Personally I'm surprised the app doesn't just crash straight away.Also, the Debug Runtimes will be shouting and screaming about a bunch of stuff. You should turn them on and listen to what they have to say.
Which MMO format/theme's can generate revenue?
Game Design and Theory;Game Design
I would like to invest some time creating an MMO. But I want some return for my work. Not necessarily a lot of profit but a steady flow of cash.Is in fact fantasy RPG the best investment? This seems to be the genre with more fans.It seems that empire building turn based MMO's like travian are also commercial. What other formats can generate revenue?I would like to avoid niche markets.Thanks
Regardless of what it may seem like; it's not all about the genre.It's really about the quality.Take a chance and invest in pioneering something that shakes people up; chances are, if you really put your sweat into it, it can bring you back a valued return.If no one thinks it's wrong...then you probably aren't doing it right. ;) ;Quote:Regardless of what it may seem like; it's not all about the genre.It's really about the quality.It's not about quality either. Look at Tabula Rasa - quality game with a huge budget and a big developer team.Unless your name is Blizzard and your game is World of Warcraft, chances that you get enough revenue to stay alive (or even get rich) are rather small. ; Yeah for a small time developer it's probably wise to target a niche market, then at least have some gerentees. If you try to compete with the big guys, why would a player play your game when they can get the same if not better bang for their buck playing WOW? ;Quote:Original post by AwokenYeah for a small time developer it's probably wise to target a niche market, then at least have some gerentees. If you try to compete with the big guys, why would a player play your game when they can get the same if not better bang for their buck playing WOW?Because if they were the first playing my RPG they would be higher in the game hierarchy than they are at WOW? Not sure. I would think players like to be the strongest around, and get a kick killing weaker players. ; From my observation its more about accessibility first, addictiveness second, quality last. There have been many MMOs which have put quality first and have failed, because they push the machine specs too high or the gameplay isn't well balanced or tuned. Those MMOs which have gone on to become stellar success have as their first trait is accessibility ( accessibility from the standpoint of machine specs, player ui, overall presentation and usability targeting the most people they can ). Then their is the gameplay hook, that takes an experience design team, to craft addictive and fun gameplay mechanics and write interesting stories and characters around that.Lastly the polish, the quality of the music, sound, graphics, etc.. Good Luck!-ddn ; I remember reading a line somewhere that goes..."Design something that you want to play; if you enjoy it then chances are so will others."I for one can't stand WoW or any of the other grind specific/level dependant MMO's and I know a lot of people playing WoW at the moment or other MMO's just waiting for something else.ddn3 is right about accessibility being a major point to focus on. You only have to look at the success of Free Realms to see it’s a big player for anyone in the "casual" bracket.Your revenue system will play a big part I think, I'm not big on Micro-credits but at the same time you can't expect Subscriptions from new players right off the bat. ; Honestly I think your best bet would be a game like Travian that is carebear. You would still want to incorporate PVP but the basis would be PVE instead of PVP. ; In my opinion, the most important quality of an MMO is community. As long as that is there and it won't matter what the genre is.It doesn't have to be huge to bring in revenue. A game that can bring in revenue for a long time will do better than a fancy game that peters out after a few months. ; A travian type of game seems good, maybe with a gangsters theme, which is also very popular.Trying to pioneer a new type of gameplay is very risky for someone who has a limited amount of resources. Even for someone with a lot of resources. Look at what happened with O2's mankind.The formulas that work are the ones already being used. On the other hand the giants leave little chance for the newcomers. Maybe with local advertising one could gain some entry into the market.
slimDX VMR9 allocator sample needed !!!
Graphics and GPU Programming;Programming
Hello everybody i am trying to convert the VMR9allocator Directshow sample to SlimDX version just for educational purposes and i am stack it will be appreciated if someone can help me with my code or if there is any samples available that will be a great help!!!!
One post is enough [smile]If this is a different problem, you'll need to give more information. If not, you're welcome to bump your previous post (Which I'm about to do by replying anyway...)
Storm - Now a finalist at 2BeeGames Indie Game Competition
Your Announcements;Community
If you recall, I had an Image of the Day posted a few weeks ago about my game project, Storm. It was a finalist in the 2BeeGames Indie Game Competition. Well, it is now in the final round of voting, and is one of the remaining 4 games. If you would like to support me, please vote for my game before Sunday night. Tell your friends, too! This may very well be the starting point of my career. I would greatly appreciate your support. My website is: www.anachronology.com.Here is an overview of my game:Gameplay Video: ">Video 2: ">OverviewStorm is a physics based puzzle game for the PC. You control some the elements of a storm to guide some balls to their destination. These elements include wind, rain, and lightning.StatusStorm is currently a prototype. It is a finalist in the Indie Game Competition at 2-Bee Games, and was made in less than 2 weeks in order to meet the deadline. It is currently playable but still in a rough state; it is intended to give the player an idea of what kind of game it can become. If it wins the competition, it will be developed into a full game, possibly for consoles. These are some major features that I plan to implement in the full version: More elemental powers, such as snow, hail, cold, heat, and more Many more levels, without the placeholder art (visible in screenshot 3), of course More physics items, such as blocks, floating logs, rocks that can be destroyed by lightning, and anything else that will enable more interesting and complex puzzles A level editor/creator Nicer visual effects, such as a better water shader, background lightning and rain, and thunder that shakes the camera A much nicer user interface Additional original musicDevelopmentAll work, including, design, programming, art, and music was created by me, Terence Lee, in 2 weeks. Some samples for sound effects were used from The Freesound Project. It was made in C# with XNA, using the JigLibX physics engine. If you are interested, I can post more technical information.Future PlansIf you think this game idea has potential, please register at 2-Bee Games and vote for Storm. It is one of the remaining 4 finalists. The winner will receive a cash reward and a publishing deal. I would very much like to develop the full version of this game and have it published, so I would greatly appreciate if you would vote for Storm.Screenshots (Click to enlarge)Using the wind power. You can see how the wind wraps around the level terrain.Rain floods areas and causes the balls to float. The future version will have a nicer water visuals.The lightning power generates a random bolt of lightning. The yellow dots are "ammo" for your lightning power. In this image you can also see the blue placeholder ground that had to be used in the prototype due to time constraints. LinksGameplay Video: ">Video 2: ">Download (click on "PC Download Here"): http://www.2beegames.com/game/stormWebsite: http://anachronology.com/
3D Artist Seeking Work
Old Archive;Archive
Name: Jordan AnglemyerWebsite:www.jor3d.comExpected Compensation: Paid work, unpaid possibly Contact Information: [email protected] Experience: A couple Unreal mods, and an xbox downloadable that never got finished. Ive worked in the architecture industry the last few years and have a lot of experience with environment and structural building.Toolset: I mainly use Maya, Zbrush, and PhotoshopLooking to build my portfolio and hopefully make some games. I would obviously be more interested in paid work, but I will consider anything if its interesting and looks like it has the possibility to be finished.
hey man maybe this will interest you it unpaid until released then split revenue but check us outhttp://www.gamedev.net/community/forums/topic.asp?topic_id=538712 ; Hello dear Jordan,I checked your website and saw a few models and concept that were in the style we are seeking for the buildings/environment of our game.Please check our posting here: http://www.gamedev.net/community/forums/topic.asp?topic_id=538466Get in touch if you should be interested.Thanks in advance.
Untitled
General and Gameplay Programming;Programming
I need to extract every 10 characters from a string. Following is the code.But output is quite unambigious.int ilength = 10;char* string = "This is test program for extracting every 10th word";for(char* temp=string; temp!=NULL; temp+=ilength){printf("%s\n", (temp + ilength));}Desired output.This is test program for extrac.............etcWhere am I going to wrong.
(Assuming C)The problem with the loop above is that temp will pass the end of string (since temp != NULL compares its address with 0x00000000; *temp != NULL only works when the length of the string is a multiple of ten). temp will then point to memory outside of bounds with undefined results. You need to assure that temp will not pass the end of the string.Here's how you can do this in C:/* #include <string.h> */const int ilength = 10;const char* string = "I need to extract every 10 characters from a string. Following is the code.";const char* end = string + strlen( string ); /* use strlen to get the length of a string */char buf[ilength + 1];buf[ilength] = '\0'; /* strncpy does not copy null terminator */for(const char* temp=string; temp<end; temp+=ilength){strncpy( buf, temp, ilength ); /* copy ilength chars from temp to buf */printf("%s\n", buf );}(Assuming C++)Try this:// #include <string>// #include <iostream>std::string string = "I need to extract every 10 characters from a string. Following is the code.";const int length = 10;for ( unsigned i = 0, l = string.length(); i < l; i += length )std::cout << string.substr( i, length ) << std::endl; [Edited by - _fastcall on June 25, 2009 2:57:53 AM]
Question about "SPU Usage" from "Deferred Rendering in Killzone 2" Presentation
General and Gameplay Programming;Programming
I was reading through the Guerilla Games presentation: Deferred Rendering in Killzone 2. Most of it is pretty easy to understand, but I can't seem to comprehend what they are doing with their object rendering system. I'm just going to quote the specific slide (44):Quote:* Everything is data driven- No "virtual void Draw()" calls on objects- Objects store a decision-tree with DrawParts- DrawParts link shader, geometry, and flags- Decision tree used for LODs, etc.* SPUs pull rendering data directly from objects- Traverse scenegraph to find objects- Process object's decision-tree to find DrawParts- Create displaylist from DrawPartsLittle bits of this make sense to me, such as iterating over the list of registered objects, grabbing their data, evaluating it and finally adding it to a 'displaylist' to be processed later. But what exactly is the data that the decision-tree holds?Can anyone provide some pseudocode that implements what they speak of?
Maybe something like this:class DecisionNode{public: DecisionNode( const bool& c, RenderNode* t, RenderNode* f ) : pFalse(f), pTrue(t), condition(c) {} virtual RenderNode* GetChildNode() { if( condition ) return pTrue; else return pFalse; }private: RenderNode* pFalse; RenderNode* pTrue; bool& condition;};class Player{ RenderNode lowDetail; RenderNode highDetail; bool lowLodMode; DecisionNode node; Player() : node(lowLodMode, &lowDetail, &highDetail) { lowLodMode = false;} virtual DecisionNode& GetRenderDecisionTree() { return node; }};You create some kind of data-structures, probably with virtual functions (like my GetChildNode func above) that can choose between different renderables. Decision nodes could be used to select the right LOD model, decide whether to render a type of special-effect, etc...Instead of each object having it's own draw function where you make these decisions using code, you use these 'decision nodes' to describe the conditions for which a renderable should be drawn. ; Ah, okay, thanks for the input Hodgman. That definitely makes sense, and is certainly very data-driven. I guess I overcomplicated the situation because in my mind I was imagining something of or relating to the decision trees they use for AI. :DWell, once again, thanks. I'm going to try to implement this in a little test tech-demo of sorts I guess. ; It's worth pointing out that they *probably* aren't making much (any?) use of virtuals, and it's highly doubtful that they'd do anything clever like storing references to external bools. All of the data needed to evaluate decisions is almost certainly in a tight block of data coupled to the object itself. This is meant to run on SPU, after all... ;Quote:Original post by osmanbIt's worth pointing out that they *probably* aren't making much (any?) use of virtuals, and it's highly doubtful that they'd do anything clever like storing references to external bools.Yeah, I have to agree, they are probably bagging the vtable. ; interesting link.although its worth pointing out that SPU's have very minimal scratchpad memory, and wont be doing things like large tree traversal etc within the memory they have (they are also not very suited to random access memory pattern tasks). its likely the PPU will do the actual traversal, or they have a nice DMA friendly tree structure that they can process linearly without needing to perform random memory accesses.they wont be using virtual functions, or playing with vtables, the code will be compact, simple, and with as few branches as possible. think of SPU's as sort of like shaders with local memory, bidirectional DMA, and seriously kickass math performance. cache, and DMA are critical to SPU's. they are very very powerful, but its tricky to keep them fed with data to process.anyway, its mostly academic unless you actually have a ps3 to play with. the things to take away from the article are that they hand most of the processing off from the main CPU for render list generation (a good thing to copy, especially on multicore cpu's) and that they are doing a lot of processing, both in shaders, and on CPU. itd be interesting to see actual metrics on time and performance of such a solution. it sure does look good when its all said and done, but damn thats one complex renderer :);Quote:Original post by Matt_Dthey are also not very suited to random access memory pattern tasks) True in general but DMA lists are available and do allow it for when its needed. I implemented a radix sort that works on large data sets with random access and can keep it going. I had to pad the individual DMA transfers to 16bytes thoughQuote:anyway, its mostly academic unless you actually have a ps3 to play with. the things to take away from the article are that they hand most of the processing off from the main CPU for render list generation (a good thing to copy, especially on multicore cpu's) and that they are doing a lot of processing, both in shaders, and on CPU. itd be interesting to see actual metrics on time and performance of such a solution. it sure does look good when its all said and done, but damn thats one complex renderer :)I think how the evolution of every PS3 engine is like this,1) Implement renderer on PS3 really quickly to show producers that you got it working2) Profile - RSX is too slow3) Move subset of render pipeline to SPU4) Profile - RSX is too slow5) Move subset of render pipeline to SPU......9) PPU is too slow10) Move subset of simlation to SPU....A few years later you have complicated ping pong of data structures between 5 spu's, a ppu, the RSX, and probably some random middle ware on that 6th SPU.-= Dave ; Yeah, Matt_D, I'm actually working with a PS3 Linux setup and I was interested in trying to implement something similar to Guerilla Games for a little technical demonstration. ;Quote:Original post by Halifax2Yeah, Matt_D, I'm actually working with a PS3 Linux setup and I was interested in trying to implement something similar to Guerilla Games for a little technical demonstration.except the PS3 linux side of things doesnt allow for shaders. so you can only do half the job.;Quote:Original post by David NeubeltA few years later you have complicated ping pong of data structures between 5 spu's, a ppu, the RSX, and probably some random middle ware on that 6th SPU.-= Davei know exactly what you mean :) seen it happen a few times.luckily ive also seen well designed stuff from the get go. it tends to be a lot stabler, has less bugs and is far easier to maintain than some overly complex spu ping pong :)nice work on the radix sort :) what kind of throughput were you getting?
What exactly makes C++ difficult?
For Beginners
I am curious. What makes C++ more difficult than any other language. It's powerful and you have to keep track of everything, but that isn't hard to do. I should probably search more, but all I've seen on the subject is that C++ requires more memory management while easier languages do that for you. Most of my experience so far comes from learning C++. I've learned a little Java and VB. However, I haven't done much of the last two I mentioned.I was wondering if anyone can point me in the right direction to truly understanding the differences between the languages and what makes them harder and why?
That's the thing -- it's not difficult.The problem lies in the number of pitfalls associated with the raw power of C++. While the syntax is generally easy to understand and pick up, it's the subtlties of the language grammer that catches beginners off guard.The biggest pitfall with C++ (which it inherited from C) is the use of pointers. As powerful as they are, there are so many programmers that just don't understand how to properly use them and you start ending up with unitialized and dangling pointers both of which have the general effect of causing your program to train wreck.Beyond the simple pitfalls is the OOP nature of C++. Many times beginners misuse and abuse classes and their most powerful features: inheritance and polymorphism. Couple this with pointer abuse and you have a recipe for disaster.On top of all of this is the low-level memory mangement, bitwise operations and operator overloading that can be very confusing. Much of the memory management, however, is easily done for us through the use of the standard template library (STL) but its syntax can be quite intimidating to the unitiated.The long and short of it is C++ is not a difficult language to learn. It's a difficult language to master due to all of its subtlties. ; The best way to learn the differences is to keep writing programs in all those languages. Along the way you'll write programs with bugs, and some of those bugs will be due to language deficiencies, and some of those bugs you'll spend days or weeks trying to figure out.The language that results in the most frustration is your most difficult language. ; 1) C++ is a federation of languages.It contains a syntax similar to plain C (with enhancements for Object Oriented programming), but it also contains a template meta programming language (which can act as a compile-time functional language!), a pre-processing language and the standard library (AKA the STL).Many people only learn about half of these things when "learning C++".2) C++ does not try to protect you from your own stupidity.Whereas some newer languages have friendly abstractions like "This variable is a handle to an object", C++'s abstraction is more like "This variable holds a memory address, which could be interpreted as the address of an object".This allows you to do things like pretend that one object is a different type (deliberately or accidentally), which could cause memory corruption or other strange behaviors.3) C++ supports OOP, but doesn't force it upon you.People who have learnt in languages like Java might find it hard to adjust to this.Java-style multiple inheritance is a lot easier for your average coder to use than C++ virtual inheritance.[edit]You've also got access to C's standard library as well!Many people who use C++ actually use the C library rather than the C++ library. ; You should read this thread. Particularly, my post in that thread contains a classic example of why C++ is hard. Also, Ravyne's post explains that the language isn't always the problem, but the non friendly error messages the compiler generates.But there are other things you need to know in C++. For example, is the memory in std::string contiguous? Is it in std::vector? Do you know and understand the Rule of Three? Do you know how to properly handle exceptions and how to throw them, including how to throw one in a constructor and not leak any allocated memory? Do you know what undefined behavior implies (I'll answer this one: just because your program appears to be working doesn't mean you don't have a massive bug that is just waiting to blow up in your face after you've released your product)? In what range are you legally allowed to increment/decrement a pointer to a block of memory in? What identifiers are reserved for the implementation? How can you avoid the static initialization order fiasco? What is the static initialization order fiasco?Aside from lots of these types of questions I could ask, there's also a lack of functionality in the C++ standard library. For example, Java and C# and VB all have ways for letting you connect to the internet, download things, send emails, easily handle multithreading, etc. Not so with the C++ standard library. You either have to roll your own code or google for a 3rd party library that can do all this, and then you have to take the time to get familiar with that library, probably build it yourself, link it, etc...[edit]ninja'd += 2; ; Learning object oriented programming?I originally learnt C, it was a great low level language but large programs could get messy, not to mention rogue pointers. then came along Objected Oriented programming which made designing programs cleaner.These days you shouldn't even need to learn a language, to develop a program just plug in the right components you want into the proper development tool and HEY PRESTO! you have something like what you wanted! .. maybe? Well that's what I want anyway! LOL!padlock.; Also noteworthy is that C/C++ is very low level and powerful. That means you can do anything with it, everyone has source code for it, and it is "compatable" with every device.But it is NOT a RAD language out of the box. A RAD language like Python or C# gives you a lot of extra features, and covers a lot of extra cases so you don't have to think about them. This makes prototyping things very fast. Expecially when some RAD languages actually look almost like what is termed "pseudo code".C/C++ usually means there is a lot of base work and setup involved in getting even the smallest project running. Hop over to python and you can have the same app (maybe not as fast, extensible, or complete) up and running in a usable form in only a few hours work.It is similar to the comparison of Windows/iProduct/Wii type things vs PS3/linux type things. One may have all the features, but you need a manual to figure it out. The other holds your hand through all the common stuff, but makes your life a pain in the ass once you want to dig deeper.;Quote:Original post by KulSeran and it is "compatable" with every device.Not exactly. I can't use C++ on an iPhone, for instance. That uses Objective-C which is totally different. I couldn't use C++ on a Nintendo 64 because that uses its own special ASM instruction set.My toaster isn't 'compatible' with C++ either.What it boils down to is that any environment with a C++ compiler that follows ANSI standards is likely to be able to compile any program you write so long as you don't have platform specific code in it (e.g., trying to use MessageBoxEx() on Linux won't work just as trying to use signal() won't work on Windows).Quote:Original post by KulSeran2) C++ does not try to protect you from your own stupidity.This is thee biggest point. C++ doesn't save you from yourself unlike languages like BASIC, PHP, JAVA and so on. With power comes responsibility and abuse of that responsibility results in programs that fail. C++ does exactly what you tell it to do regardless of whether the instruction is erronous or not. This often leads programs to train wreck spectacularly and just 15 years ago could easily crash an operating system (which for now will remain nameless). It is because of the fact that C++ doesn't try to correct for errors that it appears 'difficult' and many bugs come from the improper use of pointers. Probably the most annoying thing and most difficult to find error is the 'dangling pointer' -- this is an error in which the programmer has freed memory from a specific location but continues to attempt to access the memory. The program may continue for many seconds or even minutes before you get what's called a seg-fault. This is a particular problem with beginners and if you're not intimately familiar with your debugger can take weeks to track down and a great deal of frustration. This, alone, is what gives C++ its reputation of being difficult to learn (in my humble opinion, of course).Anyway, that's far more specific than you probably cared to hear and since you're asking what makes C++ difficult you probably don't understand most of it. Suffice it to say that you'll be spending months figuring out what made your seemingly innocent program blow up which could be frustrating but once it clicks it suddenly becomes an amazing language with very little in the way of limitations. ;Quote:Original post by leeor_netNot exactly. I can't use C++ on an iPhone, for instance. That uses Objective-C which is totally different. I couldn't use C++ on a Nintendo 64 because that uses its own special ASM instruction set.Sure you could. If you had a C++ compiler for the Nintendo 64 system you'd be able to use C++. And you can, actually, use C++ for the iPhone, though Objective-C is what is mainly used.Quote:Original post by leeor_netMy toaster isn't 'compatible' with C++ either.You should upgrade your toaster then. It's out of date [smile] ;Quote:Original post by leeor_netNot exactly. I can't use C++ on an iPhone, for instance.Yes you can ;pObj-C is only required for parts of iPhone dev ;)[edit]dammit, ninjad!
How is this letter of explanation for my academic probation?
GDNet Lounge;Community
So last semester I was put on academic probation. I dropped a few courses, passed one, and failed another. Fully my own fault. I really regret it. I'm applying for osap, a government student loan. They estimate I'll get $10,800 based off how much I make, my parent makes, and my cost for tuition, books, and transportation. Before they accept my loan I need to write a letter explaining why I'm on academic probation.Here's what they needQuote:You have been placed on academic probation for OSAP purposes. Because you have not maintained satisfactory academic progress, you must provide a letter of explanation outlining your situation including the reason(s) you have not progressed academically. This letter should also outline your academic objectives. You must also provide a copy of your transcripts from previous institutions for the past two years of study (if applicable).also, osap says Quote:You must also provide a copy of your transcripts from previous institutions for the past two years of study (if applicable). I've only been at this one institution. Do I need to provide my transcripts? They obviously have access to them as they were aware I'm on academic probation. The "if applicable" makes me consider this because you couldn't be on academic probation if you've never been to college, and the only other way they'd not be applicable is if you were at one college only.finally here is my letter so farQuote:Letter of Explanation Concerning Academic ProbationUnfortunately, I have been placed on academic probation due to poor performance previously in my computer programming and analysis diploma program . During my second year I opted out of applying for OSAP in hopes I would be able to work and go to school. My intentions were to minimize my student loans I would be required to pay once I graduated. I had school 5 days a week and worked all weekend and often after school as well. I did not properly anticipate the stress of working and going to school without a day's rest. In addition my travel time was two to three hours each day. These multiple factors negatively effected my time and energy I had available to me after school to keep up on my studies and projects. I am deeply regretful I allowed myself to fall so far behind that year and now have a new vigor and energy to apply myself this year in an attempt to keep on course.I'm currently taking a summer semester as I plan to get back on schedule and perform as well as I know I can. Unfortunately I'm not able to work the long hours necessary to afford tuition, books, and transportation in addition to applying myself effectively to my studies as I demonstrated last year. I've taken reduced hours at my job so I have more time to focus on school. I'm doing exponentially better this summer semester and now at the half way mark even have a 100% in my systems366 course. I intend to get my GPA back up to a minimum of 3.0 so I can apply for the co-op program and gain valuable real world experience. I have an uncle with the Toronto police who has expressed great interest in helping me with this goal. I am now very grateful that there are services such as OSAP to help students like me make the most basic of ends meet so that I have the energy and time to focus on what is important, my education.any criticism or advice?
Isn't there someone at your school who can answer your question about transcripts? Don't start your explanation with the word unfortunately. If you must use that word, bury it at the end of the sentence. Don't talk about your intentions first. Talk about them second. You tried working your way through school, but the commute used up too much of your time and your studies suffered. You do well in your coursework when you have time to study. You're getting guidance from your uncle the policeman. Please help me out with a loan. That sums it up. ;Quote:Original post by LessBreadIsn't there someone at your school who can answer your question about transcripts? Don't start your explanation with the word unfortunately. If you must use that word, bury it at the end of the sentence. Don't talk about your intentions first. Talk about them second. You tried working your way through school, but the commute used up too much of your time and your studies suffered. You do well in your coursework when you have time to study. You're getting guidance from your uncle the policeman. Please help me out with a loan. That sums it up.Okay I'll take unfortunately out. The use of 'intentions' were in reference to what my plan was when I failed. The first paragraph is why I did poorly, the second paragraph is what I'm currently doing and plan to do to fix it.I'll ask the loan office at the school. I can't access my transcripts online because I owe money for my next semester so they don't let you see them till you pay. I'm sure the front desk will be able to help me though.;Quote:any criticism or advice?Quote:These multiple factors negatively effected my time and energyDid you see anybody about this? maybe a councillor or a Doctor?If so get a note from them which describes your situation and there professional opinion on the matter. If not then your really should have and this may serve as reminder to anybody who is reading it and in the same situation. I know from experience how valuable a note from a professional (especially a Doctor) can be in these situations. ; i didn't speak to anyone that could write me a note confirming this... :( ;Quote:Original post by JavaMavaI can't access my transcripts online because I owe money for my next semester so they don't let you see them till you pay.What the... ;Quote:Original post by ValdermanQuote:Original post by JavaMavaI can't access my transcripts online because I owe money for my next semester so they don't let you see them till you pay.What the...My college has a wbesite you can log into to choose classes for next semester, see your grades for, look at your time table, change your contact info, see what you owe, ect.If you owe money they lock features like choosing classes, viewing grades, ect. I know it's odd.; I just checked my college website to see how I can get transcripts. Says they are free to current students, cost $10.50 per yer for non students. HOWEVER if you have fees owing, like me, you can't get them. ;Quote:Original post by JavaMavaI just checked my college website to see how I can get transcripts. Says they are free to current students, cost $10.50 per yer for non students. HOWEVER if you have fees owing, like me, you can't get them.Oh great! Sounds like a Catch22 if I ever heard one!p.s. But yeah my college does the same thing but you can usually get unofficial ones pretty easily. One of the dean's at my college even looked them up on his computer for me one time. You could try that?; Just being picky, but "exponentially" is not the right word. It's a big word people use to sound impressive, but it's not correct usage here.
Tabs Studio adds advanced tab grouping to Visual Studio IDE
Your Announcements;Community
Tabs Studio adds advanced tab grouping to Visual Studio IDEGrouping relevant tabs together is an efficient method to work with a lot of code files simultaneously. Tabs Studio add-in started from grouping tabs with the same name and from the same folder. New version of Tabs Studio allows custom rules to group tabs by different parts of tab title and group tabs from different folders. Using regular expressions for custom grouping provides utmost flexibility for rule definition.Grouping by name combines Class1.h and Class1.cpp, while grouping by .resX extension can combine Animations.resX, ComboBox.resX and DateTime.resX. When resources and code are in different projects, custom document path grouping rule can allow grouping for Toolkit\Animation.cpp and ControlToolkit\Animation\Animation.resX. Another benefit of grouping is that relevant files can be quickly opened by right clicking on a tab and selecting corresponding file from a list.About Tabs StudioTabs Studio add-in replaces the built-in Visual Studio 2005/2008 tabs giving you multiple rows of tabs, automatic tab grouping, ability to remove path from tab name and ability to customize visual representation of tabs with powerful XAML styles.Tabs Studio homepage: http://www.tabsstudio.com
What books did developer read for game development in the 1990s?
For Beginners
I want to make a game But I wonder how game developers worked in the 1990s, how they made games, how they learning before the Internet became as widespread as it is today. etc.how do they know how to build game mechanics as character ability power up system?how they know to reverse engineering game competitor company.what book I should read?
As far as I know (not being a programmer myself), books on the subject started appearing in the early 2000s. Up to that point, it was “learn by doing” and tips from one another. ;The first book that came to mind was Tricks of the Game-Programming Gurus: Lamothe, Andre, Ratcliff, John, Tyler, Denise: 9780672305078: Amazon.com: Books, which was geared toward beginners/students/amateurs. There were others, but that's the best selling pre-2000. After that point in time, game development became a hot topic in the book publishing world. Even GameDev.net has a series - Beginning Game Programming: A GameDev.net Collection (Course Technology Cengage Learning): 9781598638059: Computer Science Books @ Amazon.com.Otherwise, in the professional realm a lot was “learn by doing” as Tom said, or through word of mouth on early Usenet/IRC/websites (pre-GameDev.net in 1999 - see About GameDev.net). ;Computers in that era didn't have an OS like we have today. The machine booted, and you were dropped in a command shell or in an interactive BASIC interpreter. You basically programmed directly at the metal. Video memory was directly accessible, by writing in a known address range you could make pixels appear at the screen in various colors. The “OS” had a corner in the memory too for its data, but nothing prevented you from poking around there. Lua, Python, C#, C++ didn't exist, ANSI-C was just invented (K&R book about that was in 1989 iirc). Assembly language of course did exist (with books) and was used.Monthly computer magazines were published for all types of home computers. Tips and tricks were exchanged in that way, also program listings were printed in those magazines that you could then enter at your own computer. Studying those listings, and trying things for yourself is how you learned. There was also technical documentation about the computer.If you want to enjoy that stuff, today there is a retro-computing movement, that lives in that era, except with slight more modern hardware but still no OS, etc.;Alberth said:Computers in that era didn't have an OS like we have today.In the 1990s there was MSDOS, Several versions of Windows, and of MacOS. And that's not all the operating systems of the nineties, most likely.Like Linux, for instance.;Tom Sloper said:Alberth said:Computers in that era didn't have an OS like we have today.In the 1990s there was MSDOS, Several versions of Windows, and of MacOS. And that's not all the operating systems of the nineties, most likely.Like Linux, for instance.Yep. There were things like Windows 95, Win 98, and at the time I was still using a Commodore Amiga (AmigaOS) .To deal with the original question “what game dev books was I reading in the 90s?” Back in that era, one of my favorites was : The Black Art of 3D Game Programming by André LaMothe. ;Abrash was the guy who did the Windows NT graphics subsystem and worked on Quake.https://www.drdobbs.com/parallel/graphics-programming-black-book/184404919 ;There are a couple of" history of video games" books, that track the rise of the medium and genre.Just google for them. ;GeneralJist said:There are a couple of" history of video games" booksThat's not what the OP is looking for.;Thanks all
Choosing a career in AI programmer?
Games Career Development;Business
Hello everyone, my name is Ramon Diaz; I am currently studying Game development and programming at SNHU. I have taken the initiative to learn about a professional career in AI programming. I have a lot of gaps in my development in the short term. I have blueprint experience with AI but not enough to choose a career in this profession. I would like to know how I can be competitive leaving the university in 5 months after finishing my studies. I am looking for knowledge from all of you who have been in the industry for years.
Entry level? Know your algorithms, it will help you at interviews. If you have made demos it can help you get jobs, but the market is wide open right now and should be relatively easy to find work for the foreseeable future. Overall, it reads like you are on the right path. When you graduate and start looking for work, be open to any positions rather than just an AI specialty. Once you have a job it is easier to transition into whatever specialty you prefer.;Thank you. ;I would like to know how I can be competitive leaving the university in 5 months after finishing my studies.Talk about last minute. Create AI projects? Or A game with character behaviors? Pathfinding examples. Crowd movements. Anything really. Learn how navigation meshes work.;@dpadam450 Character Behavior is what I doing in the project at this moment. Everything related to AI programming.;@dpadam450 Is it the same when learning C++ in AI as visual scripting Blueprint? If I were to make a demo, what kind of programming should I focus on my attention? ;@frob It is important to have a portfolio? ;Not for programming. You will need to show you know how to do the work, but it is usually some interview questions and writing some code of their choice. If you have something you want to share with them, you can do it if you want. Having done fancy demos can sometimes help get interviews, and can help show your interest and abilities, but it is generally not needed. It does not hurt, unless you do it badly and therefore becomes a cautionary warning. Build it if you want. I have interviewed and hired bunches of programmers without portfolios. ;I'm studying AI at the moment, in terms of statistical learning. I've learned so much about AI over the past few weeks. Check out: https://hastie.su.domains/ISLR2/ISLRv2_website.pdf​andMachine Learning with R: Expert techniques for predictive modeling, 3rd Edition
Newbie desperate for advice!
Games Business and Law;Business
Hi allI'm new to the game development community and need some advice.I've created 2 educational games with a simple idea but are sufficiently challenging for all ages. These could be played on pcs or phones.Is it worth patenting any parts of the games?What would be the best way to monetize?How should I market the games?
hendrix7 said:I'm new to the game development communityReally? Your profile shows that you've been a member here since 2004, and your last activity was in 2007, asking about raycasting.hendrix7 said:Is it worth patenting any parts of the games?Probably not. Expensive and there will be hurdles, and possible lawsuits after the patent is granted (if it is).hendrix7 said:What would be the best way to monetize? How should I market the games?There are several threads here in the Business and Law forum about that. While you wait for more replies from the community, you can read up on those previous answers to those questions. Mainly, “you should have thought about that before you finished your games.” (You wouldn't be “desperate” now.) Good luck with your sales!;@hendrix7 Filing for a patent can be expensive, and you need to document the solution and how it separates from anything else. I have developed software that solved problems in a way that no other software does, but there is only a very small portion of that that can actually be patented. Even though you can file an application yourself, I would recommend hiring an experienced IP attorney. This too is very expensive, though, so you are best off doing this if this idea can provide millions in income. If it can't, then it's actually not that harmful if anybody copies it.You could look at registering trademarks, design and other parts of the games. This is cheaper, but it will protect you brand more than your idea or solution.Again, if this is something that could turn a real profit, it might be worth looking into. If not, it's a very costly waste of time.As for marketing - my day job is actually creating videos and commercials etc., so naturally that's the first thing that comes to mind.Make videos for social media or other platforms where your target audience is likely to see it. Oh, and you need to define a target audience. Know where they are, what they respond to, what their struggles are and how your product will solve their problems, enhance their life experience or in other ways contribute positively to their life.There are several other ways to do this, but the list exceeds my level of expertise in the area.;patenting is costly, and time intensive. As said above, it depends on a lot if it's worth it. ;@hendrix7 Nothing is worth patenting unless you're willing and able to defend your patent. There is no patent police; you're responsible for finding and prosecuting infrigement.What you're patenting has to be novel and non-obvious to a person skilled in the art. You called your idea ‘simple’ which makes me wonder if it's obvious or already in use.;@Tom Sloper Thanks TomI have been programming for a while but not games until now.Thanks for getting back and your advice, particularly patents.;@scott8 Thanks for your reply.I see. The play of the game utilises basic maths skills so I'm guessing it'll be difficult to identify anything that's unique. I suppose, in a similar way, it would be difficult to patent something like ‘Wordle’. Am I right?
Hi I'm new. Unreal best option ?
For Beginners
Hallo everyone. My name is BBCblkn and I'm new on this forum. Nice to virtually meet you 🙂. One of my biggest dreams is to make my own videogame. I love writing design as in text on how my dream game would be. Now I got no skills to create it. But who knows what life will bring. Is Unreal the best program to have fun with an experience ? Obviously I prefer a simple but capable program. Not pre designed auto drop. Why not install Unreal and roam into it and see if anything happens.My favorite games are in the genre of Fantasy, usually stone age with magic. Dota, Homm, Diablo and the odd one out is the genius Starcraft 1. But I played plenty of different games, especially when I way younger. I don't game currently at all but designing gets my creative juices flowing and is so inspiring and fun. Thanks for having me guys
BBCblkn said:My name is BBCblknI am truly sorry for you. Even Elons daughter has a better name than that.BBCblkn said:Is Unreal the best program to have fun with an experience ?Give it a try, but it's not meant for total beginners.Starting small always is a good idea. 2D is easier than 3D. You could try GameMaker, learn some programming language, learn some math, move on to more advanced engines like UE or Unity… ;There's honestly no perfect program for beginners. If I had to compare Unreal though at my skill level, I would probably pick Unity. However, It really comes down to your needs, and how much programming you want to learn. Furthermore, I would also keep in mind other engines.;@BBCblkn I'd recommend Gamemaker studio 2 as a first engine. It's easy to learn and I haven't had a problem making my game ideas in it yet.There are some good tutorials on YouTube to follow to learn it. Do note you'll be limited to 2D games with GMS2.Bit late to the post, but I hope it helps;gamechfo said:Bit late to the postTwo months late. Always consider whether you honestly believe that a question asked long in the past is still awaiting an answer. Thread locked.
How to publish a book?
GDNet Lounge;Community
Hello, So, over the holidays I finished my 1st book. Do any of yall writer types know where I can find:an editorpublisherIt's like 99% done, just need to know what to do next. Also, it's cross genre, so it doesn't necessarily fit the standard model.
You've given nowhere near enough information to get a final answer, but I can suggest next steps for you. (For background, I've worked as an author, co-author, editor, and ghostwriter on 9 books so far.)Publishing is a business deal. You need to figure out what business services you need.Do you even need a publisher? Do you need a distributor? You already mention needing an editor. Do you need marketing? Do you need retail agreements? Digital or physical? If physical, POD or offset, how many each of hard or soft, what size of print run can you afford? What business services do you need? Publishers have an awful lot of potential features of what they can provide and what those services cost.Once you know the list of services you actually need, your favorite bookstore will have books that have listings of all the major publishers and hundreds of minor publishers, along with the services they provide and the specialties they work with. Work through the listings methodically, and talk to them all until you've got a deal. You'll also want to start shopping around for a lawyer at that point, both because they have connections and because they'll be working with the contracts you'll be signing.Once you know what you need and have talked with your lawyer the first few times, you will be ready to start shopping around. It's far better if you have more money and are using the publisher as a paid service. That is, you pay them for the services they provide up front. It will cost you many thousand dollars but you'll require far fewer sales to reach profitability. It can be better to do an online plus POD service starting out if you're self funded. If they need to front any of the money there will be two phases to the deal, one phase before it's profitable and another after a threshold is reached and it's profitable. The exact terms will depend on your needs and the services they'll be providing. Before you sign with anyone, you'll need to work back and forth more than once with your lawyer to help you negotiate what's fair in the agreement. Good lawyers understand the costs of the various services and can help you get fair rates.Just like publishing games, the more you need from them the harder your pitch becomes. If you need a lot of services the more it will cost you. If you're looking for them to invest in you, front you money, and pay for the books, don't expect a lot of money from the deal, and in addition your pitch needs to be amazing and you'll be rejected many times. If you've got the money to self-publish and are only looking for retail agreements that's rather easy. ;hmmmWell Self publish might work too. I'm looking for:an editor publishing distribution for ebookNo hard cover or physical book planned at this timemaking cover art. Future Audio book production. I think that's it. I'd be willing to do physical print if needed, but I don't really want to pay for that at this time. frob said:You've given nowhere near enough information to get a final answer The issue is I don't know what questions or criteria I should be asking or looking for. ;Have you considered publishing with Packt?https://www.packtpub.com/;GeneralJist said:2. publishing distribution for ebook 3. No hard cover or physical book planned at this timeFor distribution of an ebook there are plenty of options. Amazon is the biggest with kindle direct publishing requiring little more than an html file and an image for the title. If you are comfortable with software tools you can use that same document to build/compile every other format out there. You're on the hook for everything else with the business if you go that route, but it can work well if you are marketing through your own channels.There are many ebook publishers out there targeting specific platforms and specific readers or specific genres. I mentioned publisher lists, they also include electronic-only publishers. Understand the tools they use against piracy are also helpful since otherwise anybody with access to the file can make unlimited copies.Be careful of contracts, you almost certainly want something that has a non-exclusive agreement since you've done all the work yourself already. If a publisher wants an exclusive deal they need to be putting quite a lot on the negotiating table.GeneralJist said:4. making cover art.Find an artist with the style you like and contact them. Often it's in the range of a couple hundred bucks, especially for ‘unknown’ artists when they're starting with something that wouldn't have seen the light of day otherwise. Artist friends are best, and asking around at local art schools is inexpensive.GeneralJist said:5. Future Audio book production.If you don't need it now, it's something easily done later.GeneralJist said:1. an editorThis one is the most difficult. Skilled editors are amazing. If you go with a publishing house they'll provide professional editors, at professional rates. ;taby said:Have you considered publishing with Packt?https://www.packtpub.com/hmmm 1st time hearing of them.Looks like they are more of an educational option?My book is a mix of mental health journey auto bio, and Sci Fi elements. It's not really a standard “how to” for game dev. ;so I just heard back from my 1st publisher submission.https://triggerhub.org/​And they essentially say they be willing to look at it deeper, and have extensive edits to focus on the mental health angle. but they would want me to cut a lot. From what they are hinting at, It sounds like they want to cut a lot of the Game dev and gaming journey, as they are a publisher focused on mental health.So, now I need to decide what to do.I sent them back an email saying I'm open to continued dialogue.Without knowing exactly what they want to cut, and edit, I don't know how to proceed.Also, would it be better to hold out, and find a publisher that is willing to accept most of the game dev journey, as I'm looking for a continued publisher to work with, aka accept most of the book as is. Any advice would be helpful.Thanks yall. ;GeneralJist said:Any advice would be helpful.Look into your own mind and heart.;hmmmok,So I've submitted to a few other places.We shall see.I submitted to this place called author House, and they got back to me really quick, but it looks like they want me to pay a couple thousand for a package:https://www.authorhouse.com/en/catalog/black-and-white-packages​I personally find that a bit frustrating.I mean, really, I wrote the book, I thought traditional publishers get paid from a % of sales?@frobWhat do you think?Is the above package a good deal?I was also a little put off, as it seems the person who called me didn't even read anything about my book, and asked me “so what's your book about?"beyond the above, how does this usually work? Edit: so, after a bit of basic research, it seems the above organization is a bit scamy. The hunt continues. ;You're unlikely to get a publisher deal, where the publisher pays you an advance and distributes your book to retail outlets.You'll have to self-publish, meaning you have to bear all the costs for printing, and nobody will distribute it for you. https://en.wikipedia.org/wiki/Vanity_press​
First-person terrain navigation frustum clipping problem
General and Gameplay Programming;Programming
I am trying to develop first-person terrain navigation. I am able to read a terrain and render it as well as to move around the terrain by interpolating the location of the camera every time I move around. The main problem I have is that depending on the terrain, i.e. moving on a sloping terrain, the near plane clips my view (see below). What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.
I believe this can aways be an issue. I mean if you are clipping to a near plane and that plane passes through geometry, it has to do something. That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it. Another other thing to consider is once you have collision working, you can put your camera, including your near clipping plane inside a collidable object, for instance a sphere, such that this problem will never occur. If you are eventually going to make this a real first-person game, that should take care of the problem since your camera will be inside the players head. Even in a 3rd person game you can put them inside a floating sphere. ;Gnollrunner said:That being said you technically don't have to clip to a near plane at all, however many graphics APIs require it.The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.mllobera said:What is the best way to avoid this? Presumably, I can interpolate the heights for the bottom corners of the near plane … any help would be appreciated.Yes, basically you want to ensure that the camera is in empty space (above the hightmap), not in solid space (below the heightmap).But in general you can not treat the camera as a simple point, because the front clip plane requires a distance larger than zero. So ideally you build a sphere around the camera which bounds the front clip rectangle of the frustum, and then you make sure the sphere is entirely in empty space, for example. In the specific case of your terrain not having too steep slopes however, it should work well enough to sample height below camera, add some ‘character height’, and place the camera there. That's pretty simple and usually good enough for terrain.It's quite a difficult problem mainly for 3rd person games in levels made from architecture. It's difficult to project the camera out of solid space in ways so the motion still feels smooth and predictable.Some games additionally fade out geometry which is too close, attempting to minimize the issue.Imo, the ‘true’ solution to the problem would be to let the clipping happen, but rendering the interior volume of the geometry as sliced by the clipping plane.That's pretty hard with modern rendering, which usually lacks a definition of solid or empty space. But it was easy to do in the days of Doom / Quake software rendering. When i did such engine, it was possible to render clipped solid walls in simple black color. This felt really robust and not glitchy, so while it does not solve all related problems, i wonder why no game ever did this. ;@undefinedJoeJ said:The near clip plane is always needed, even if you use a software rasterizer. If you don't do the clipping, vertices would flip behind the camera, causing glitches way worse than what we get from clipping.You can clip to a pyramid instead of a frustum. I used to do this many years ago on old hardware. So there is no near clipping plane. In fact you don't need a far clipping plane either.Edit: Just wanted to add as far as I know the near and far clipping planes mostly have to do with optimizing your Z resolution. If you are dealing with that in other ways, I think they aren't strictly necessary. I currently don't even deal with the far plane and let LOD solve Z-fighting issues.;Gnollrunner said:You can clip to a pyramid instead of a frustum.I see. You still have front clip. It is a point, formed indirectly as the intersection of the other other frustum planes.I've misunderstood your claim to be ‘you don't need a front clip’. But you didn't say say that. Sorry. But now i'm curious about the experience with z precision you have had. I guess it just worked? Which then would probably mean: All those painful compromises of ‘make front plane distant so you get acceptable depth precision for large scenes’, are a result of a bad convention being used by APIs?Or did you use no z-Buffer? ;@undefined My whole engine is based on aggressive LOD and culling. I don't do projection in the matrix. It's a post step. My Z coordinates are world distances. My current project does have a near clipping plane mainly because DirectX wants one, but it's not that relevant for my application.;Ah, so you use the pyramid for culling only. But for rasterization, the usual front clip plane at some distance i guess.Still an interesting question if ‘some distance’ is really needed, but i guess yes.I did some experiment about point splatting. It uses spherical projection, which is simple than planar projection:auto WorldToScreen = [&](Vec4 w){Vec4 local = camera.inverseWorld * w;if (local[2] < .1f) return (Vec3(-1)); // <- front clip at some distance of 0.1Vec3 screen = (Vec3&)local;screen[2] = length(screen); // if it was zero, i'd get NaN herescreen[0] = (1 + screen[0] / (screen[2] * camera.fov)) / 2;screen[1] = (1 + screen[1] / (screen[2] * camera.fov)) / 2;return screen;}; Planar projection would cause division by zero too, i guess.;Thanks for all your comments! I will need to investigate how to do what Gnollrunner proposed (about putting the camera inside of a sphere). ;This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, it likely makes some sense to have a smaller near-plane distance for the former than the latter.Now, this only ameliorates the problem, it doesn't remove it entirely: it means that the problem will still appear, but only if the player gets very close indeed to a surface. It's intended to be used in conjunction with one or another means of preventing the camera from approaching quite so near to a surface (such as the sphere-approach mentioned by others above).;Thaumaturge said:This may be obvious, but in case it helps:Let me note that, as a first-person camera may be more likely than a third-person camera to draw very close to geometry, I'm not sure that's so true. I mean in both cases you have to take care of the problem somehow. The case of a first-person camera is a bit easier because it should always be in the collision boundary of the player (sphere(s), ellipsoid, capsule etc.). As along as the near plane is also within that boundary, the problem should never occur. So if you have a 10cm radius sphere and put the camera in the back of it, that gives you maybe a 10 to 15 cm camera to near clipping plane distance to play with depending on the field of view you are going for. With a 3rd person camera, you can also get very close to terrain, in fact your camera can end up within terrain or some object if you don't do anything to solve that problem, and this will happen very often without separate camera collision. One typical way to handle this is just implement your following camera, ignoring terrain considerations. Then to figure out your camera's actual position, project a line back from the head of the avatar to the camera's ostensible position, and see if it intersects anything to get the camera's true position. In reality you should project a cylinder and not a line since your camera will need its own bounding sphere to contain the near clipping plane. In any case this means that as you move around your camera can jump forward to clear terrain and objects. I've seen this in a few MMOs. However, when you leave blocking terrain you have the option of implementing smooth movement back to the cameras desired location. If you want to get really fancy, I guess you could try to predict when your camera will need to jump forward ahead of time and try to do smooth moment forward too. Maybe you can have a second camera bounding sphere which is somewhat larger, that would trigger smooth movement, but I think you would still need a fallback camera jump routine to be safe.
Sprite Artist/2D Illustrator Seeking Work (paid projects ONLY)
Old Archive;Archive
Name: BuFFoWebsite / Portfolio: AwesomeSauceStudio (website is currently in production, so don't mind the smallish portfolio and dead links.)Expected Compensation: Money. When you hire me, your game gets done. You get what you pay for.Contact Information: buffo (at) awesomesaucestudio (dot) comPrevious Projects: Various Game Art for - borgata.co.nr, awakenedmmo.org, dso.zidev.com/index.htmlI am also partner with a coder and together are creating a game of our own. All website design, graphics, game art and game sprites are by me. My partner is the coding wizard who puts it all together :) Game has over 5000 hand drawn sprites by me. Game is not fully playable at the moment as we are doing a coding and graphical overhaul.cubiclebattlesI mainly do 2d Illustrations and sprite work, but if you are looking for something (I dabble in 3d modeling, but I am far from a pro) and would like to see if I can draw what you need, please feel free to ask!I have also done various magazine illustrations etc... Remember to check out my website for my full range of sample art styles.Thank you!BuFFo[Edited by - BuFFo on June 24, 2009 10:56:36 PM]
Hi BuFFoI was wondering whether you'd be interested in joining the Tower City team. Here's a link to the details of the project. We're in great need of a 2D artist of your standard and it would be great for you to join us.This project will do wonders to expand the portfolio of anyone who joins.Thanks;Quote:Original post by TierceHi BuFFoI was wondering whether you'd be interested in joining the Tower City team. Here's a link to the details of the project. We're in great need of a 2D artist of your standard and it would be great for you to join us.This project will do wonders to expand the portfolio of anyone who joins.ThanksYeah, your game looks very interesting actually.You can email me directly at my email in the original post. Shoot me an email and tell me what you need, and we can take it form there. Thank you :)- edit - I sent an email to the contact person provided in the link you gave me. Don't know if thats you or not. ; I have just finished another piece. This one in a slightly different style than the rest of my work. ; Here are some more pictures I recently drew.If you are looking for a 2d artist, concept artist, sprite artist, hit me up.More samples of my art in the link provided in original post. ; Very nice work. I'll send you an e-mail. ; Here is another piece. I finished it today for a magazine.; For some odd reason the style I have been doing lately is a very cartoony type of style. Any who, some more art I recently did, either for myself or other projects.I guess the chibi style would be a good style for fantasy browser games, or whatever. If you need me, you know where to find me.; Just updating some extra art for variety's sake.; Here are some samples of the sprites I did/am doing for Cubicle Battles. There are a set of human characters and robots. If you do not see both sheets of sprites, refresh until you do.
[FPS/RPG] Sci-Fi Game Seeking to Fill Positions
Old Archive;Archive
TEAM NAME:Poly GamesPROJECT NAME:BRIEF DESCRIPTION:Starfall is a sci-fi FPS/RPG hybrid taking place on a foreign planet in the middle of a rising military conflict. It uses narrative elements to immerse the player in its intricate storyline without affecting its gameplay-oriented approach.Gameplay mechanics include several RPG-based elements inspired from precursors of this genre such as Deus Ex and System Shock II, which allows for customizable character progression. Levels take into account these choices and attempt to give the player as many options as possible to complete their objectives.We are attempting to integrate the modular level design idea where an area has dynamic use. While objectives are linear, interactions with the environment are more organic and the player will often revisit the same locations for different reasons, experiencing different events in such spots. It should increase the player’s emotional response to the actual environment. This allows us to keep the scope of the game to a more reasonable size mainly because most of the game will revolve around a ruined city and its many areas of interest.SETTING SUMMARY:The player plays the role of the “Kheops” unit, an android biomass character that does not emulate the American hero syndrome. He resembles a scientist in nature and logic and has come to this planet in search of answers. At the time where the game starts, he has just been “activated” and his mission briefing has failed to load in after the crash. Provided with adaptability databases and material, the character will attempt to self-repair his own neural system interface and will slowly enter the strange world that lies before him.Two factions are already at war upon the territory. One, comprised of a leading (unseen) species governing a few different tribes to do their bidding upon the soil they have inhabited for decades, the other, a belligerent society that has only just begun their final onslaught against the planet. After a few years of planetary bombardment, the final clash has erupted, and the Kheops unit is to determine whether the conflict between these two factions threatens the existence of his masters located in a remote system.TARGET AIM:Commercial COMPENSATION:Voluntary. May include royalties if commercializedTECHNOLOGY:- C++ with DirectX/OpenGL- Photoshop CS3- 3D Studios Max, Maya, Blender, Etc - Other preferences can be used such as Blender, Milkshape, Etc- Currently considering between several engines; Ogre 3D, Irlicht, and a few others. TALENT NEEDED: 2D Environmental/Architecture ArtistsResponsibilities: - Create Architecture, or Environment concepts based on the ideas discussed with the team. Ex: Buildings, and the surroundings.- Analyze ideas, by developing initial sketches to help visualize the proposed idea. 2D Character/Object/Vehicle/Misc ArtistsResponsibilities: - Create Characters, Objects, Vehicles, Special Items, Power Ups, Etc concepts based on the ideas discussed with the team. Ex: Player Characters, Vehicles, etc. - Analyze ideas, by developing initial sketches to help visualize the proposed idea. 3D Architecture ModelerResponsibilities: - Create architecture models based on concepts provided by the artists.- Develop initial level design ideas, and seek completion.- Import levels into a proper level editing program, and setup correct lighting. (Optional) 3D Character/Vehicle/Etc ModelerResponsibilities: - Create character, vehicle, weapon, and other types of models based on concepts provided by the artists.- Develop initial gameplay ideas to be discussed with the team, and taken one step forward towards getting the correct feel, and mood for the game models.- Import character/vehicle/etc models into a proper level-editing program. (Optional) Engine/GUI ProgrammerResponsibilities: - Work with an engine of your choice using C++ language.- Develop, or implement a physics engine to fit the needs of the game.- Develop engine functions needed for the game to reflect game mechanics as outlined in the design document.- Develop, manipulate, or add GUI interface that will function, and reflect the overall style, and theme of the game. AI ProgrammerResponsibilities: - Work with an engine that will be chosen by the programming team, and develop AI for the single player portion of the game. - Develop, and work on other types of AI that may be implemented later down the road. Tools ProgrammerResponsibilities: - Work on a special level creator tool that will allow the team, and possibly players to construct custom levels. Other tools will need to be created as well.- You will need to design, and implement this tool into the engine.- Help, and assist the programming team if help in certain area is needed.TEAM STRUCTURE:- Poly Games: Graphics Artist, GUI Designer, Level Designer, 3D Modeler - Jars: Game Designer, Programmer, General Help- Trio: Architectural Concept Artist, Environmental Concept Artist- Kylecito: 3D Modeler - Sage: Building Modeler- Arran: General Modeler - Bishop: Concept Artist - Ryan: General Programmer - Guth: AI Programmer- Zerex: General 3D ModelerWEBSITE:Project: StarfallCONTACTS:PM here if interestedPREVIOUS WORK BY TEAM:- Worked on Unreal Tournament, and Halo mods.- More information can be provided to potential team candidates.ADDITIONAL INFO:Currently, a thirty-page design document exists outlining most of the game concept, mechanics, and the story of the game. For more information, or clarification, please reply here, or send me a pm. Trio's Example Artwork: NOTE: Any images, or information posted in this thread does not represent the final quality of the game.SCREENSHOTS:Shot 1:Shot 2:Shot 3:FEEDBACK:Any[Edited by - polygames on July 25, 2009 11:38:57 PM]
Hmmmm I'm surprised we didn't get much attention?True to say gamedev forumers are usually quite nervous when it comes to outsiders coming in only to advertise their project.Do not worry all though as I'm part of this project and I'm an more or less active forumer myself :PEh, sorry I can't get much more spare time to spend on here, my work at ubisoft is kinda exhausting these days...I gotta say I didn't join for the money, but since we're all dedicated, this can help expand a portfolio (I used it to get into the industry after all ;)) ; If this is going commercial, who will pay for the licenses for 3ds max and maya, photoshop is probably feasible for purchase but 3d application will be steep. ; sent you a PM ; Correct me if I'm wrong, but personally written contracts mean nothing when dealing with two different countries. I ran into this problem already with a team. Me being in Canada and another person being the United States, we couldn't have our contracts endorsed legally. For example, if you lived in Chad, good luck being able to get the other person who lives in Brazil to court, when they don't honor their contract. I'm not sure what a lawyer could do for your contracts, however this wont be free.Due to the scale of this project, you would be better off paying people for their work completed. For example, per model made, or finishing a physics system. You have a pretty big list of jobs needed, along with required responsibilities. You will have to dish out money anyhow before selling this game due to your licenses for 3DS Max, Maya, Photoshop, and the C4 Engine.I don't see who would invest this amount of time for no guarantee of getting paid, people have to eat you know. ;Quote:Correct me if I'm wrong, but personally written contracts mean nothing when dealing with two different countries.<NDA, stands for None Disclosure Agreement if you aren't aware of this already. NDA is not meant to be any sort of legal contract other than protecting the privacy of the company, or the team you're joining. In this case, you are correct it holds no real hold on the person from another country, but is still a requirement by most legit companies, or team that seek good, and dependable people. This doesn't always succeed, but at least it helps to filter people who aren't really interested.Quote:Due to the scale of this project, you would be better off paying people for their work completed. For example, per model made, or finishing a physics system.If I had the funds, don't you think I would have listed that under "Compensation" ? Not everything runs on money, some people do things because they love what they do, or have other reasons for joining teams such as this one. I bet that if I would have listed "Open Source" game you wouldn't even post a reply. I believe this game has promise, and can be created without much initial investment at the beginning. Quote:You will have to dish out money anyhow before selling this game due to your licenses for 3DS Max, Maya, Photoshop, and the C4 Engine.It is assumed that anyone who joins has a legal copy of any of the above programs I've listed. It is the responsibility of the owner to obtain the legal versions. I am a licensed user of C4, and all of the programs I've listed. I hope I answered all of your concerns. If anyone else is still interested, we are still looking for members. ; As I've stated myself, I've joined this project out of mere requirements for a portfolio. I know companies look for people who are able not only to work in a team, but in a team they did not lead. As most of my previous experiences involved myself as being leader, I have boarded this project unsure what would happen next. Well I've got the job at that specific company, and I can say I owe it to what I was able to bring in the interview regarding that specific work. I'm not looking for compensation myself, and I know I'm not the only one in that position. ; 3dsmax and maya are expensive program going from 2000 to 4000 us dollars per license, I believe most teams put the licenses fee on the studio's budget. This might reduce your chance of finding potential & legal members to work on your 3d models.; Regarding the contract part, I was referring to what security do other team members have on receiving funds. I wasn't talking about keeping quite on the project.Open source projects have nothing to do with anything in this topic.I'm sure lots of people would want to join your project because they love making games. However I'm talking based on personal experience with teams, people may seem very motivated at the start but you wait a few months into development, people leave. Money motivates people to work, not to mention if they're getting paid you will get results a lot faster. They will treat this project like a job, not a weekend project and soon leave due to lack of motivation or other things. I'm also assuming this game is at least going to take a year or more to complete, which means you need to keep people around that long for free.Pick up teams from what I've seen rarely produce full scale games because people never like sticking around. I've been in a few teams programming, sadly it becomes really hard to keep writers, artists, and composers around for free. Not to mention talented programmers who have the talent to make games on their own, and will. Teams generally stink unless they consist of good friends or payed workers. Project leaders even left after a few months on some games I worked on.Don't get me wrong, I love your idea for the game here, I've been looking forward to playing a good Space RPG for a long time. Even the model work you've shown is impressive. I just don't think it's realistic to expect people to work for free on such a lengthy project. Making games isn't always fun, it also requires a lot of motivation to keep at it. ; It is not the first time I receive this form of criticism, and as well founded as it is, I beg to disagree. I have worked on long-term unpaid projects in the past with much larger scope than the one we are trying to achieve here (details enclosed in the design document could answer a few fears here as to the actual scope of the game). Dedication isn't always found in the form of money. I've seen it at work before, I'm pretty sure a good leader can pull it off again. I'm hoping he has the leadership for that.Your concerns are duly noted however, but bear in mind others will wish to join, and a handful of them will stick to the end despite everything. It is true that the mobility may be a factor to be concerned with, but every project has to deal with some form of mobility, even in the commercial branch. People come and go, that is how the industry has come to work lately, and the true leadership comes from adapting well to this rapid change between two different minds and skill base and attempt to keep the cohesion of the project.I guess I'm also part of the team for this very specific reason. I have experience with mobile teams within a single projects and it has worked wonderfully for me so far, therefore, I'm willing to take that risk.And as I have said before, these kinds of projects have made the best part of my portfolio thus far and it did pay back in due time so, as much as I'd like to put it on the count of my magnatic personality ;) the truth is companies care about what you can do in awkward situations rather than comfortable ones.Thanks for the comments though. Criticism is always a form of interest :P
Dark Empire action rpg needs modelers.
Old Archive;Archive
Digivance Game StudiosCompany registration pendingDark Empire (Code name)We are currently calling this project "Dark Empire" with plans to change the name to something a little more compelling later in design.Brief description: This is a medium to large scale indie action rpg game that will place our player in a "steam punk" like atmosphere. All characters in the game (player included) can use both melee and ranged weapons ranging from swords and daggers up to laser weapons. The game places our player in a fantasy world that allows them to build and customize their character through skills, stats and abilities. The storyline is a captivating story of love, betrayal and war (all the making for a best seller no?). Through exciting and compelling game play, and an intense plot twisting storyline we believe we can successfully create a commercial quality video game.Target aim:RetailCompensation:Profit SharingTechnology:Ogre3D Rendering EnginePhysXOpen Input System (OIS)Crazie Eddies GUI (CEGUI)SDL MixerC/C++Expat (xml parser)Talent needed:Modelers: We are in need of modelers to trace the concept images from our artists into 3d models. We currently have one artist working on some drafts and may have another joining soon.Writers: We are also looking for another writer to join the staff and help with various items such as story line and dialog writing.Programmers: We are also looking for one more programmer that is familiar with the above listed technologies to assist with coding both the Map Editor and the Game Client programs.Team structure:Dan - Team Leader / Lead ProgrammerTony - Lead DesignerNick - ArtistWebsite:http://darkempire.digivance.com*Requires you sign up for an account to view more info*Contacts:[email protected] - (Email and MSN)DigiDayor - (AIM and YIM)Previous Work by Team:Many examples of the Ogre3D tutorials that can be found via their wiki. These are slightly modified versions that display a working knowledge of the systems that will be used in the game. There is also a demo application that shows the usage of all the features that have been learned via these tutorials. The programming team is currently working on the Map Editor for this project which should have a short demo available within the next week or so.Additional Info: We have began production on a custom map editor that can be used by the team to create the world's used in the game. The designers are pushing the content and story line along nicely. We have recently recruited a new artist, and may have another one joining the team soon.Feedback:ENCOURAGING ONLY[Edited by - Subinac on June 24, 2009 10:32:32 AM]
The storyline is compelling and will keep player interest throughout the twists and turns. I really think this is going to be very successful. Looking forward to being a part of it.; Nice to see more people working with Ogre! Sounds really interesting, but looking at your technology I see PhysX, which (still) isnt portable. So shouldnt we expect a Linux version? ; I was unaware that PhysX isn't portable... Thanks for pointing that out, I will start researching better technology. ; If by portable you mean multi-platform, then you are incorrect. PhysX will run on Windows, Linux, the Wii, xbox360 and the Playstation 3.However if the extra few percent of user base from Mac OSX is really important to you, you could look into Bullet, which is another popular Physics API. It will run on the same platforms, Mac OSX and iPhone. Personally I prefer PhysX over Bullet and if you're using Ogre there's NxOgre which helps integrated PhysX into Ogre. There's also OgreBullet, but I don't think it's maintained quite as much. ;Quote:However if the extra few percent of user base from Mac OSX is really important to you, you could look into Bullet, which is another popular Physics API. It will run on the same platforms, Mac OSX and iPhone.Are you sure PhysX doesn't support OS X? (Unity uses PhysX and is Mac/iPhone-compatible...) ; Oh, that's right. I forgot Unity uses it. They use a modified version though, do they not? They may have ported to OSX themselves. I just couldn't find any info on OSX/iPhone. ; ** Original post edited to reflect recent progress & changes. ** ; We have just recently recruited a new concept artist with 2 more potential artists on the way. Our Map Editor program and story line are well on their way and we have about half of the main characters of the game designed. We are still in need of modelers to help convert the concept art to reality, we are greatly considering adding another designer / writer and possibly another programmer. Please read the original post which has been edited to reflect the project's current state for more information and contact details. ; I would be interested in being one of your modelers. You can check out my portfolio (work is still being upload but it was a busy week because my house flooded) at www.hunterstudios3D.com. If you would like to send me one of your concepts so that I could show you what I am capable of I would be happy to do so. Hope to work with you.
Is ESRB mandatory for non-boxed game?
For Beginners
Is ESRB mandatory for non-boxed game?Thanks
Are all games required to have a rating?The rating system is voluntary, although virtually all games that are sold at retail in the U.S. and Canada are rated by the ESRB. Many retailers, including most major chains, have policies to only stock or sell games that carry an ESRB rating, and most console manufacturers will only permit games that have been rated by ESRB to be published for their platforms.Sourcehttp://www.esrb.org/ratings/faq.jsp#2 ; I think you just answer your own question. :) It's not required unless you want to sell the game in a store that requires a rating or have it sanctioned/publish for one of the major consoles. They'd probably run into constitutional issues (in the U.S at least)if they required every game to be submitted to the ESRB. ; I think it depends on the country.I've heard that all games being sold in Australia for example (whether boxed or digitally distributed) need to be rated by the classification board. Don't really know if that's true or not. ;Quote:Original post by Sc4FreakI've heard that all games being sold in Australia for example (whether boxed or digitally distributed) need to be rated by the classification board. Don't really know if that's true or not.From what I've read, in my distinctly-not-a-lawyer-so-don't-take-this-as-legal-advice perspective, it's against OFLC regs to sell an unclassified game if the seller is in Australia (whether retail or digital download), but it's okay for an overseas digital distributor to sell games to Australia (or at the least it's a grey area. This Massively article explains it a bit more.) It's something I'm going to check in more detail if I try to sell a game myself, though.In practice it's something I suspect the authorities wouldn't try to clamp down on because it's almost impossible to enforce. Australian authorities can't dictate what overseas digital shopfronts do, so the only approach they could take would be to prosecute Aussie buyers, which wouldn't exactly be popular with voters. It's not worth the cost to enforce. However it's not something I'd try to risk abusing, like specifically making a game designed to be as offensive and unclassifiable as possible and then deliberating trying to market it to Australia over digital channels.To the OP: if you're planning on selling your own games but aren't sure if a formal rating is worth it, you can try using TIGRS. It's a self-serve rating system I've seen used in a few places by indies.
Lesson 44
NeHe Productions;Affiliates
Hi,Lesson 44 is the lens flare tutorial. Apparently, it has occlusion testing. If the situation is right, it can be done vastly more efficiently. In Python:model = glGetDoublev(GL_MODELVIEW_MATRIX)proj = glGetDoublev(GL_PROJECTION_MATRIX)view = glGetIntegerv(GL_VIEWPORT)winx,winy,winz = gluProject(lightpos[0],lightpos[1],lightpos[2],model,proj,view)winz = glReadPixels(winx,winy,1,1,GL_DEPTH_COMPONENT,GL_FLOAT)pos = gluUnProject(winx,winy,winz,model,proj,view)#if pos and lightpos are basically the same and 0<winx<view[2] and#0<winy<view[3], then the light is visible; draw the flare.I used this technique to produce:The planet can occlude the sun's flare. It does so perfectly.Hope this helps,Geometrian
Slow Multithreaded Rendering in Windows
Graphics and GPU Programming;Programming
Hello all,I am trying to set up an OpenGL rendering in its own thread. I'm using SDL to set up the context in the main thread (so SDL event handling will work), then switching the context to the rendering thread using wglMakeCurrent(). That all seems to work, but when I make even a single GL call (like glClear() for example), my frame rate plummets. I only call wglMakeCurrent() once (at startup), so I don't think there is a context switch slowing things down every frame. Here's how I've set things up:This is called from the main thread to set up the context:bool Setup(unsigned int width, unsigned int height, bool isFullscreen) {if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {printf("Error: Unable to initialize SDL: %s\n", SDL_GetError());exit(1);} atexit(SDL_Quit);const SDL_VideoInfo* video;video = SDL_GetVideoInfo();if (video == 0) {printf("Error: SDL Error: %s\n", SDL_GetError());return false;}SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);if (SDL_SetVideoMode(width, height, video->vfmt->BitsPerPixel, SDL_OPENGL) < 0) {printf("Error: SDL Error: %s\n", SDL_GetError());return false;}SetupGL();// SDL doesn't let you handle events in one thread// and render in another. This releases the// OpenGL context so we can switch it to the// rendering thread#if defined (SUNSHINE_OS_WIN32)mCurrentContext = wglGetCurrentContext();mCurrentDC = wglGetCurrentDC();wglMakeCurrent(NULL, NULL);#endif // SUNSHINE_OS_WIN32return true;}This is called from the rendering thread to switch the context from the main thread to the rendering thread:void SwitchThread() {// Switch the OpenGL context to this thread#if defined (SUNSHINE_OS_WIN32)wglMakeCurrent(mCurrentDC, mCurrentContext);#endif // SUNSHINE_OS_WIN32}Then when I draw from the rendering thread:void Graphics::Draw() {Clear(); // Wraps glClear(...)Present(); // Wraps SDL_GL_SwapBuffers()}I know this isn't a synchronization issue, because I've tested the rendering thread with non-rendering work, and there is no slow down. Any ideas?Thanks!
Seems strange, what Windows version and compiler etc. are you using?You seem to use an unusual pixel format.. with 5-5-5 colors, why not use the standard desktop format, which should be 32 bit on all modern computers?Does it work fine, if the only difference is that you call Draw() from the main thread?I would try to set up a minimal application without wrappers or anything that does the exact same thing in one or two threads, to make sure that is the problem. ; I have isolated the slowdown to the OpenGL calls made by the rendering thread. If I wipe all of the drawing code out of Draw(), things run as they should, but one call to GL, even if it's to simply swap the buffers, slows everything down.I am compiling using Visual Studio 2008 on 64 bit Vista. I suspect that the problem lies in Vista's implementation of GL, which I believe simply wraps a DirectX context. If that's the case, calls to wglMakeCurrent() might not implicitly switch the DirectX context to the new thread. Versions of DirectX prior to 11 are guarded by a single mutex, the locking of which could be responsible for my slowdown. I'm going to try to create the GL context with WGL in the rendering thread instead of using SDL to create it in the main thread and switching it to the rendering thread (which is what I should have done in the first place, but I was being lazy). I'll let you know how it goes.Thanks for your reply! ; I also have Vista 64 bit and threaded rendering works fine for me, though I don't use SDL..I create everything in the main thread, and then simply start another thread that does the drawing. I use the following flags for the pixel format, PFD_SUPPORT_COMPOSITION which is necessary to work with Aero, if I remember correctly:pfd.dwFlags =PFD_DRAW_TO_WINDOW |PFD_SUPPORT_OPENGL |PFD_SUPPORT_COMPOSITION |PFD_DOUBLEBUFFER;
Developing Directx 10 Games on XP
General and Gameplay Programming;Programming
Has anyone tried the hacks that allows dx 10 programs to run on XP?Does this also means that programming dx 10 on xp will be possible though might not get the full performance or risk getting problems?
Quote:Has anyone tried the hacks that allows dx 10 programs to run on XP?I'm not anybody special enough to fully answer your question but as nobody else has come in, I'll throw 2p in. AFAIK the only things I heard about when hearing XP and DirectX 10 in the same sentence was "No" and something called the "AlkyProject", I don't know how it works or anything but I know development on it has come to a grinding halt. Also, since they're nothing more than a few hacks you can guarantee they're unstable and certainly won't have Microsofts backing or support.Quote:Does this also means that programming dx 10 on xp will be possible though might not get the full performance or risk getting problems?No, not really, I may be wrong here but AFAIK the reason DirectX 10 never appeared on XP through Microsoft was because XP uses a completely different driver model which is needed to run DirectX 10.HTH,NB.Edit: BTW, you'd probably get a couple more responses if this was in the DX forum, see if a mod can move it for you. ; The AlkyProject was basically a scam, a bunch of half baked code cooked up by some idiot to gain a lot of publicity. There's nothing resembling competence behind it.The answer to your question is that it won't work. Sadly the amount of investment needed to expose DX10 or even some kind of DX 9.5 compromise wasn't worth it to Microsoft. Thankfully 10.1 and 11 introduce feature levels to rectify the other half of this, which is the hardware support limitations. ; The short and sweet answer is that it's not happening. The DX10 runtime and driver model required changes that go fairly deep into the OS...it's not something you can hack around.Your best options are to either get Vista, get the Win7 RC, or get an Nvidia GPU and use OpenGL (ATI GPU's don't expose full DX10 functionality through GL). ;Quote:Original post by PromitThe AlkyProject was basically a scam, a bunch of half baked code cooked up by some idiot to gain a lot of publicity. There's nothing resembling competence behind it.Woah..Quote:Original post by MJPYour best options are to either get Vista, get the Win7 RC, or get an Nvidia GPU and use OpenGL (ATI GPU's don't expose full DX10 functionality through GL).I got a Vista laptop which overheated 3 times... heard lots of problems with nvidia drivers and VistaThanks for the info, gamedev roxs ;) ;Quote:Original post by Twinblad3rI got a Vista laptop which overheated 3 times... heard lots of problems with nvidia drivers and VistaThanks for the info, gamedev roxs ;)I have a 8800gts and a Lenovo w/ Quadro 2700m that have been running vista for over a year, and the drivers are totally fine. the laptop overheating isn't necessarily vista's fault. The OpenGL support is actually pretty cool... The Nvidia Cg toolkit is a great example of what he described. ;Quote:Original post by PromitThe answer to your question is that it won't work. Sadly the amount of investment needed to expose DX10 or even some kind of DX 9.5 compromise wasn't worth it to Microsoft. Thankfully 10.1 and 11 introduce feature levels to rectify the other half of this, which is the hardware support limitations.The main problem with DirectX 10 is that it is Vista-only and many people didn't want to switch to Vista.I should be complaining as well that my hardware isn't supported by Direct3D 10 either, but I guess that's my fault. I should be moving to x64 and get 3GB more of RAM at least, in fact >_>' And a new hard disk to expand what I have now. 160GB eventually will be like 160MB =P But that's going off-topic. ; http://wiki.winehq.org/DirectX-ToDo-Possibly port D3D10 to Windows XP If any group has the credentials, wine is included. ; XP is already long obsolete - close to 2 full releases old now. By the time WINE gets around to making something that might work, XP will be long forgotten.It'd be like porting DX9 to Windows 95 today - I'm sure you somehow could, but why?
MMO in development storyboard stage ATM
Old Archive;Archive
Let me rephrase this old post. Myself and a friend are looking for more team members to join us in our studio(online at this time) We are looking for serious 3d Modelers, Artists, Concept Artists, Composers, and more. Company website currently under development. Experienced need only PM me. Please include all experience as well.ThanksDaveG[Edited by - DaveG78 on July 1, 2009 2:05:20 PM]
My New Blog!
Your Announcements;Community
Hey Everyone!its been around 2 years since I first joined gamedev, and man have I come a long way. Out of college, working fulltime, and me and a couple of friends are trying to get a startup going in our free time. I started a blog for our team today and want to start contributing back to what you guys have been giving me. I spend most of my time in the ogl, game programming, graphics, physics math forums. Thanks to all who helped me in those areas. Maybe now I can help/entertain you!
MMORPG combo/keybind system
Game Design and Theory;Game Design
One great thing about modern MMORPGs is that the player has a wide variety of abilities to choose from when attacking their enemy. The problem with this is that a game with a decent level of complexity can quickly become a game of organizing keybinds on the keyboard. So I tried to come up with a simple way of reducing the number of buttons a player would have to use while maximizing the number of abilities available to the player per key. I came with a variety of ideas but I think I have settled on one that is both simple and effective.The player would have a set number of stances with an equal number of attacks per stance, with each attack corresponding to one of the stances. Each attack will reset the players stance depending on the stance attached to the attack.For example, the player has 5 stances, each with 5 attacks for a total of 25 attacks. At any time the player will have 5 attacks open to them. If the player attacks with attack #1 while in stance #2 the stance will use ability 1 in stance 2 and reset to stance #1. One benefit of this system is that it is relatively simple for the player to pick up and understand. Another benefit is that all abilities are at a maximum only one attack away.Such a system could be incorporated into a console MMORPG which primarily use 4 primary keys which would allow 16 abilities to be bound to those 4 keys.I would also add that I am not assuming that the player is only using these 4 or 5 keys. There should still be plenty of keys left over for other abilities.---------------------------------------------
Alone this isn’t much of a system so I think it is worth trying to see what it would be like to try and incorporate some other elements into this system. I will borrow combat systems from other games to illustrate some of the potential of this system.The WOW Rogue has a combo point system where the player builds up combo points, 1 to 5 and then has finishers which cash in on those combo points. There are a couple different ways a combo point system can be incorporated into the stance system.1)There can be one button that turns the 5 attacks into 5 finishers.2)The finishers can just be separate from the attacks. In this case 25 build up attacks seems a bit much so maybe only 4 or 3 keys could be set up for build up attacks.3)Once the player hits 5 combo points they open up their finishers.Another option deals with the impact the various stances have on the player. The stance can come with buffs. For example the player’s defense can increase in one stance and their offense increase in another.Or there can be special buffs in addition to the attacks that can only be used in certain stances. The buff wouldn’t change the stance of the character even though it is dependent on the stance.The abilities in the various stances could be themed. Maybe there could be a stance with only CC attacks, maybe a defensive stance, etc. Or maybe all attacks that lead to a certain stance are CC, or defensive or whatever.; After messing around with this system a bit more I think 4 abilities and 4 stances is plenty. There can be a ton of interaction between the abilities for various combos and attack chains.What I have found is that abilities don't have to be balanced but attack chains do. For example you can have a stance with relatively weaker abilities but have all the best abilities in the other stances lead back to th weak stance. There can also be builders built into the weaker stances. For example a builder can improve the damage of the next attack and lead the player to stance #3. In stance #3 there can be 3 damaging attacks and a stun. The stun doesn't receive the benefit of the + damage but it is a very powerful ability anyway so it can be worth it.Also, a buff that adds to the next attack probably isn't as interesting as a buff that adds to the next 2. You can also use abilities that are more likely to trigger some effect. For example if you trigger buffs off of crits. There can be combos that increase crit chance.There can also be counters built into the attack chains or abilities that have range. CC and damage over time abilities also create interesting attack chain potential. ; I really like this idea in terms of keyboard real-estate. I know when I used to play a rogue in WoW there were always some moves that I wanted to use occasionally, but since they weren't my main set of moves they were always out of the way and therefore difficult to hit when I needed to. The option of introducing more complicated combos appeals to me too, since it gets really dull performing the same attack over and over.I'd like to know how these moves are set up - does each stance have it's own set of moves, or do you get a bunch of moves to choose from and you put them in the stance bar yourself to create your own combos? If that is the case, does a move have "stance 1, leads into stance 2" and you chose from a set for that particular slot (or maybe could lead into a choice of stances)?Something that came to mind while I was reading is an enhancement (maybe) to the system, where the move sets represent combo steps rather/as well as stances. For example, move sets 1 and 2 could both be in the same stance or could be different stances. Characters who focus on 1 stance get more moves / more proficient at moves for that stance, while characters who flow between multiple stances have the benefit of confusing the defender, making it harder to block the attacks. Implementing this would depend on the skill system you are building into the game and also thinking up more benefits for each play style. ; I played a rogue in WOW too once upon a time. Well as I used the term "stance" every stance has it's own set of moves. Each move in that stance will lead the player to a different stance with it's own set of moves(attack 1 in stance 1 will lead the player to stance 1). An easy way to demonstrate this is to create a box with 4 columns and 4 rows. Each row is a stance and each column is a button. For each combo of stance and button there is a unique ability. Honestly after trying to actually establish an interesting 4 by 4 set I think that this system will need a lot of play testing to get right and it is a lot more complicated than I initially thought.I think that players will be going from stance to stance a lot. It is not like the warrior stance because a stance won't really define a tactic. Instead an attack chain could define a strategy by offering synergy. For example you can allow an attack chain that hops through all the stances but each attack could offer bonuses to defense.The players will be min/maxing attack chains so with a 4 by 4 box you really have to offer distinct incetives that differentiate the paths. ; Here are some concepts from an old game design document that I still have left over that you might find of interest.Our team wrestled with the same problem and this (in part) was the conclusion that I developed and was accepted.(There's more to it than this, but this is enough for what you are interested in)[note: the paragraphing did not transfer cleanly, so I apologize for that; I didn't really want to go through and clean it all up by hand.]Quote:STANCESEach Stance contains a "holding tank", if you will, to place attacks into so that aCombination can be made.This "holding tank" is called a KATA, and is where the Active attacks (seeCombination's, Inactive & Active Attacks, below for more information) are assigned andkept by the player for use in combat.As stated, there are 3 Stances:DefensiveBalancedOffensiveA Stance will only accept attacks into it's Kata that are classed as being part of theStance's family of fighting.For instance, only Defensive attacks will be able to be placed into a Defensive Stance'sKata, and only Offensive attacks will be able to be placed into an Offensive Stance'sKata....Quote:THE COMBAT MODESEvery weapon is designed for Dueling, Small Group combat, Battle, or multiple CombatEnvironments.This does not mean that a Player raises a Skill in a specific weapon, but rather, a certainclass of weapon and a certain use of that weapon.Each Combat Mode has 3 Stances:DefensiveBalancedOffensiveEach of these stances contains a Kata.Each Kata is capable of holding up to 5 attacks, however, a specific Player may not becapable of 5 combination attacks for certain Modes and Stances depending on their Skill....Quote:SWITCHING A WEAPON'S COMBAT MODEEach weapon will carry a listing of it's capable Mode possibilities.If a weapon is capable of being used in multiple Modes then a player, at all times, has theoption to switch between Dueling, Small Group, and Battle Combat Modes respectively.If a weapon has 2 Modes under this category, a player may toggle between the twoavailable Combat Modes for that given weapon.If a weapon has only 1 Mode, then it will only be able to be used under that CombatMode. If the player wishes to use a different Combat Mode than the weapon is capableof, they will need to switch weapons.It is highly important to note that there are no restrictions that prevent a player from usingany Combat Mode in any of the 3 listed Combat Environments....It's not stated in these selections, but each Stance has the option of holding 3 Kata's.So if you have a weapon that can do all three combat modes, that becomes a total possible 27 Kata's for that weapon, and a total capacity of 135 active attacks for that one weapon type.Quote:SPECIAL MANEUVERSIn general, there are two kinds of special maneuvers.The first is referred to as an "Effect Attack" and is dependent on where a certain attack is placed in a Kata of a stance, and varies the outcome of the attack (commonly increasing damage, but also can apply other effects respectively). This method offers the option for the player to select the alternative attack at the time the attack comes up in the Kata's combination. The player may choose to bypass the option and continue with the normal combination. The Effect Attacks are not restricted to being the last attack in a Kata's combination, nor do they inherently stop a combination.The second is called a "Link Attack" and is also dependent on where a certain attack is placed in a Kata of a stance, however, these Link Attacks offer the option to the player to switch from the current Kata into another Kata without stopping the combination. This can produce extended combination beyond the normal five attack Kata combinations. The Link Attack may switch to Kata's within the same stance, or in different stances. In some cases, a Link Attack may link to a different weapon or class of magic before continuing the combination....Quote:MOUSE-CLICK ATTACKINGIn General, but not for all archetypes nor for all attacks, each press of a Left-Mouse Click will advance an Avatar one more attack through theirCombination. To stop a Combination from continuing, a player will simply stop clicking. Clicking must be done in timing to correctly trigger the next attack or the first attack will simply be repeated.If a Combination is carried out through all 5 attacks, then the attack will end and recoveryfrom the combination will start (this recovery is not artificial, but animated)....(Magic and Archery were like-wise broken down into similar systems)[edit]I forgot to add two things that I didn't quote:1) You aren't forced to use the Kata combination; you can select an attack from the Kata belt that's active at anytime, or flip to a different Kata or Stance and click any attack from that one.2) You cannot key-bind or quick-key attack's, spells, etc... The system only allows for mouse-click selection of attack's, spells, shots, etc...This even's the playing field and reduces "piano-roll" attacking (as I call it...basically where someone key-binds their attacks in a row such as 0-1 on the keyboard so that when an attack starts, they simply slide from 0 to 1 to trigger the next minute to two minutes of combat their character will do).[Edited by - Griffin_Kemp on June 23, 2009 3:46:21 PM]; That is very interesting Griff. How far did you get into development? The more I mess around with the system the more I feel I have to change it to fit other demands.Right now I am trying to use the system to develop a Knight/Paladin type of class that has honor and glory as its theme. All knights have a group buff (honor) and a self buff (glory). The self buff is what is more like the WOW warrior's stances, or the DK's "presence" system.I am also trying to incorporate the attack system into a specialization system that will be changing the impact of the attacks depending on point allocation. So there is a lot of potential for moving parts.I have run into a lot of problems along the way and atm I have settled on a system with 3 stances. Each of the 3 stances has 5 unique abilities (5 keys for 15 abilities): 3 unique builders (total 9), 1 unique glory ability (total 3), and 1 unique honor ability (total 3). The 3 builders are also used to set the “stance.” When the glory or honor abilities are used the stance remains the same.I think a "builder" system is needed because it is very hard to combine balance and interesting abilities into a combo box without something to differentiate the abilities. ;Quote:Original post by StanglerThat is very interesting Griff. How far did you get into development?Not very far, as far as MMORPG's time lines go.It ran for about a year or so.Essentially, what stopped everything was the start-up funds were running low, and the "million dollar" handshake on the executive level was never made due to some redtape failures in some contracts...so they lost the funding they needed.Other options could have probably been pursued, such as looking for funding all over again, but I think there was a general "headache" and damage on the executive level that could not be recovered...at least that's more or less the gist that I gathered.Good folks...just bad times for them.For me, it just meant that I didn't have to work ridiculous amounts on writing documents anymore, lol.At any rate, I never got to see the concept in action, as the engine was inbound via a (at the time) newly acquired collaborative company.I only was able to see the system in statistical simulators and mock-up concept forms.OK, on to your system....Quote:Right now I am trying to use the system to develop a Knight/Paladin type of class that has honor and glory as its theme. All knights have a group buff (honor) and a self buff (glory). The self buff is what is more like the WOW warrior's stances, or the DK's "presence" system.1) I like that you are thinking about theme's and acting parts according to the themes.2) Is there a reason you want to use buffs (referring to effects that enhance attributes/stats temporarily)?Quote:I am also trying to incorporate the attack system into a specialization system that will be changing the impact of the attacks depending on point allocation. So there is a lot of potential for moving parts.Meaning; attacks have different attributes which can be increased?I don't think I cited the section, but our attacks were broke down into Power, Speed, and Balance; so were the weapon skills.Weapons came with a max capacity for each of the above categories; thus displaying their "quality".So you could increase attacks specialties, but they were limited to the rating maximum of the weapon you were holding, and the capacity of your skill capability.Quote:I have run into a lot of problems along the way and atm I have settled on a system with 3 stances. Each of the 3 stances has 5 unique abilities (5 keys for 15 abilities): 3 unique builders (total 9), 1 unique glory ability (total 3), and 1 unique honor ability (total 3). The 3 builders are also used to set the “stance.” When the glory or honor abilities are used the stance remains the same.I think a "builder" system is needed because it is very hard to combine balance and interesting abilities into a combo box without something to differentiate the abilities.I'm not truly clear on this break down.I'm firstly not understanding what a "builder ability" is.Could you describe this in a different fashion possibly? ; Have you considered a combo system, where you chain attacks (like Tekken and other fighting games)?Tekken (Im not implying that you should make it THAT elaborate) can be played with a console controller, which has very few keys, so if you take lessons from it, you should be able to make interesting combat depending on combo chains which use very few keys. Some Tekken characters have different stances as well (like Hwoarang, the taekwondo-guy), which allows them special comboes not otherwise available. ;Quote:Original post by StanglerWell as I used the term "stance" every stance has it's own set of moves. Each move in that stance will lead the player to a different stance with it's own set of moves(attack 1 in stance 1 will lead the player to stance 1). An easy way to demonstrate this is to create a box with 4 columns and 4 rows. Each row is a stance and each column is a button. For each combo of stance and button there is a unique ability. Ok, I think I understand your idea a bit better now. So what you are proposing, is that every link in a chain should have it's own stance?That sounds alot like the wheel in The Chronicles of Spellborn, where the wheel will turn to a new set of attacks after an attack has been started.
Function return type vector causing segmentation fault
General and Gameplay Programming;Programming
Hello again. I seem to have run into some trouble when I try to return a vector from a function. The program crashes and in debug mode it gives me an error stating "Program received signal SIGSEGV, segmentation fault."The program is crashing at a function returning a std::vector. (More on this latter)First the class that defines the function in question.class bePhysicsEntity{ private: char *name; NewtonBody *thisbody; vector<bePhysicsForce> forces; public: ... vector<bePhysicsForce> GetForces();};Here is the definition of GetForces() as simple as can bevector<bePhysicsForce> bePhysicsEntity::GetForces(){ return forces;}So I am just wondering if there are any special rules about returning vectors and if I am missing something to cause this crash.Here is the portion of code where the crash actually takes place...void PhysicsApplyForceAndTorque(const NewtonBody* body){bePhysicsEntity *entity = reinterpret_cast<bePhysicsEntity*>(NewtonBodyGetUserData(body)); ... if(entity) { for(unsigned int i=0; i < entity->GetForces().size(); i++) { ... } }}It crashes right when it attempts to evaluate the for loop.Sorry for the code dump but I want to provide any relevant information.Thanks in advance!
Nothing special is required to return a vector by value. Though, in this case you probably want to return by (const) reference instead of by value. ; you're returning a copy of that vector, which means copying the entire vector and returning that copy. Depending on the size of the vector that could be super bad news performance-wise. return const reference instead:const vector<bePhysicsForce> &GetForces() const{ return forces;}const means you can't add to it and stuff. If you want to be able to do that then remove const from the declaration above but keep the ampersand.If it's seg-faulting it's probably because entity is a NULL or invalid pointer. Inspect the value in your debugger and see if it makes sense. I'm guessing you're not using a debugger tho... [smile]-me ; No the pointer to entity appears to be valid as I check it in the if statement which is backed up by the debugger indicating that entity is not NULL. I will give the suggestion of using const and see what happens. ; Not NULL doesn't mean valid. A non-NULL pointer can be invalid if you passed the address of a temporary, a deleted object or a similar problem.
Exporting Animations
General and Gameplay Programming;Programming
I've had a hard time finding good resources about animation and its relation to programming. So I want to start a discussion about how you implement animation in your applications but foremost games.What I've used when I want any sort of animation, like a character or something like that, I use 3DS to create the actual model with mesh, texture all that stuff, then I started off using just mesh animation and exporting it as ASCII files thru MaxScript. But that lacks very much things, like performance, filesize, flexibility etc. So what I know that I need now is implementing skeletal animation with skinning instead, however so far I've not enough information to make that with MaxScript. Maybe I'll make it with the SDK from 3DS or finding the right resources for MaxScript.Enough from my side, I want to hear how you guys and women (if any :D), how you do. From the model, animation to the export the whole way to the import within your game or whatever it is.Best RegardsRikardo
Here's my way of doing it:I use Cinema4D and XNA.First I create my models in Cinema4D, maybe with textures. Everything else won't be done in C4D, not even phong tags. I export it to FBX, since this is a supported format of the XNA content pipeline, and the export in C4D is alright.The animations are done in my very own animation editor which is close to being finished. In there I load in the model with only the geometry, texture and normal data.The editor allows you to select vertices. Having a really basic button object I can then do stuff with the vertices, like adding a matrix and weighting values, which will be the process for skinning the model. The bones will of course be transformable in the editor and will be placed on a timeline. After the animating is done, I save the model with all the animation data in another model format, so I can then use it in my games. And there we are! :DIt might be a bit long way since it took me several months to get the animation editor so far, but it was a good exercise and helped a lot for seeing how drawing models works. ; I use my own little format for both models and skeletal anims. I wrote a milkshape exporter that I intend to port to MaxScript. I don`t make my own models, because I basically suck at modeling:P ; If you are using low poly models, you might consider using MilkShape3D. You can import many different formats including several 3DS formats, and then export in the MS3D format when you are done. The MS3D editor itself supports bone based animation, which it sounds like you want. The MS3D file format natively stores the animation information in the file, and there is examples in their SDK about how to load the data as well. Plus its pretty cheap too, which is always nice...
PhysX var types and C++ types?
Math and Physics;Programming
Can you cast these harmoniously? for example.... my engine has a glVector4 class... which is nearly the same thing as a NxVec4 minus the fancy inline and such stuff (same with my matrix classes).my matrix class is just a float[16] column major array address.... which works in passing the pointer to opengl. if the PhysX API is expecting a 4x4 matrix* and I pass that pointer it should be ok right?Does this work for other types like NxVec3 (float[3]) and NxReal (float).I store all of my mesh data in native variable types, and dont want to have to rewrite or use theirs.thanks, hope this makes sense-jEDIT: i know this seems like a PhysX forum topic... but to be honest nobody responds on that forum like this one, which is uber awesome. =)
If the memory signature of the objects are identical (same member variables of the same primitive types in the same order and with the same alignment), then technically you should be able to reinterpret_cast between them and the different API's would operate on them appropriately. And that is a way to do a micro performance optimization in your code. (WARNING: that isn't necessarily true for any class or struct that has non-primitive members...gets complicated.) It might seem like you're streamlining your code and adding elegance....if you think so, read on!SO...I recommend that you do NOT do this! Why? First, it obfuscates the code. It will be hard for anyone else to figure out what is going on if they look at it. You'd have to heavily comment to make it readable. Even if you are the only developer, in 6 months without proper commenting, you'd struggle a bit to figure out what is going on. In 2 years, all memory of it would be lost and you'd look at the code and think you must have been crazy at the time. Further, you would be locking the code to specific versions of the two API's, or assuming that the two API's won't change in the future. Which might be a bad assumption.A cleaner way to do this, without getting all uber-oriented, would be to just create some simple adapter functions or macros that map between native variable types and the different API's. You do incur a bit of runtime performance loss by having to convert between types, but it tends to be a micro optimization. But merely isolating the conversion into dedicated functions will make the code easier to maintain in the case of API changes and less confusing. I would recommend looking at Pete Isensee's GDC presentations for numerous practical areas to spend time optimizing for performance, if that is one of your concerns (http://www.tantalon.com/pete.htm).; Yeah...It indeed is micro optimization, however the main reason I bring this up is trying to better understand how Nvidia wants the Dev to handle data between PhysX and a renderer. I agree that functions are the way to go. I would like to attempt fluid at some point, and hope to have a firm grasp of this by the time I get there. simulating a couple thousand fluid particles in hardware and then rendering them in my renderer is a bit scary sounding. Oh how I wish bindless graphics could apply to this somehow.Thanks for the advice... I will give that a go.
This is not a real-time chat.
General and Gameplay Programming;Programming
You don't need to bump your posts unless it's been a couple of days or so. As a rule of thumb, wait until your post has fallen off the first page to bump.GDNet users live all around the world. It's very possible that at the time you ask your question, the person best suited to answer you is asleep. So have some patience.Your problem is not "urgent", either. Not as far as we care, anyway. If you have an assignment due in a few hours, that's your problem, not ours. We don't do homework here, anyway.
When it takes me 10min to figure out I can't come up with something coy to respond with. I guess I'm going to have to agree.There is no point in people getting pissed and posting "150 views and no response!? what is this!" either. Just because the first people to read it don't have anything to say, doesn't mean the right person won't roll around to the thread at some point. Many people troll for topics that interest them on the active topics list, and just read. Or maybe your question isn't quite what they expected from the title, so they viewed, but still don't have the right input. ; One good trick is that you can bump a thread and then delete your post. But I'm sure the mods wouldn't like that.....................................(todo: write more suspicious-sounding dots) ; BUMP!Oh common now you had it coming ;) ;Quote:Original post by pinacoladaOne good trick is that you can bump a thread and then delete your post. But I'm sure the mods wouldn't like that....Don't "silent bump" either. They can see the replies and will tell you not to do it. Back in my newbie days I was guilty of this in a thread and was asked not to. [wink] ; We would rather you not do that, because we DO see them deleted posts. In fact, we like to have secret conversations about you with our deleted posts.Lol zahlman, that last one was great. Do one for zipster now. ;Quote:Original post by WashuWe would rather you not do that, because we DO see them deleted posts. In fact, we like to have secret conversations about you with our deleted posts.Lol zahlman, that last one was great. Do one for zipster now.Yeah, I knew something was up when the forum listing said "Topic Starter: Zahlman, Last Post: Washu, Replies: 0" :) ; Of course, he could have just stickied it. We don't mind them things.But bumping keeps it in AT
Uniformly sampling bezier spline
Math and Physics;Programming
I have a bezier spline and i've noticed that even though my T value is linearly interpolated, the distances between sample points is far from linear.I've considered the idea of checking the distance between two sample points and iteratively changing the sample T to achieve the desired distance between samples. I could determine that distance by dividing the spline length by the number of samples. But this sounds very approximate and hacky. Since even determining the length of the spline is an iterative and approximate method.Is there any other way to generate evenly spaced sample points on a bezier spline?
Quote:Original post by bzroomI have a bezier spline and i've noticed that even though my T value is linearly interpolated, the distances between sample points is far from linear.I've considered the idea of checking the distance between two sample points and iteratively changing the sample T to achieve the desired distance between samples. I could determine that distance by dividing the spline length by the number of samples. But this sounds very approximate and hacky. Since even determining the length of the spline is an iterative and approximate method.Is there any other way to generate evenly spaced sample points on a bezier spline?Short answer: arc-length reparameterization. (Here is a good paper on the subject.) ; What you want is called arc-length parametrization of spline curves". ;Quote:Original post by jykShort answer: arc-length reparameterization. (Here is a good paper on the subject.)Thanks, this article looks great.
question to occlusion culling
General and Gameplay Programming;Programming
Hello,at the moment my volume rendering is without any performance improvements.So I want to use an octree. The knots hold information about the alpha value. If its zero then this knot is not visible and the texcoordsof the vertices of this non-visible knot wont be send to the shader. But there is one problem. There will be sub-boxes in the octree that are visible but theyare occluded by visible boxes infront of them. At this time, the vertices ofall visible boxes will be send to the shader. So I need a way to find outwhat are the front boxes and what boxes are occluded.Somewhere I read that the octree has to be sorted front to back each time theview direction changes. But I dont understand why to sort front to back.When I've created the octree and sampled the knots with the transfer functioni set each sub-box to visible or non-visible. They have their position.And when I sort front to back, that would mix it al up. And parts will be rendered that are not visible and visible parts will be not rendered.regards,c-mos
I think what you heard about are BSP trees, which are not the same thing. They draw the scene back to front. Why send the alpha value to the shader, when it`s easier and a lot faster to simply not draw the content of those boxes.Octrees are used for frustrum culling, not for occlusion culling. You would have to use a more sophisticated algorithm for that:) ; It is used for volume rendering (gpu raycasting). So the volume is divided into smaller sub volumes. They have to be sorted in a front to back manner. the alpha value decides wether the sob volume will be raycasted or not. I dont understand why to sort the octree.regards,c-mos
2D XNA RPG (Not an RPG Starter Kit) looking for Artists
Old Archive;Archive
Team name:No Team name yetProject name:2D XNA RPG game.Brief description:I have been working to create a 2D XNA RPG for the last few months. I've been working to get a good base in place before I form a team. The engine so far has a Quad Tree base for collision and drawing. I have also implemented A* pathfinding using a binary heap for speed. I have also have a scripting system in place. The scripting will need to be expanded when more commands are needed. I have also created the battle system. The game will play similar to Earthbound/Mother series. The player will explore the map and be able to see the enemies. If the enemies do catch the player, the game will switch to turn based combat. The enemies have a sight and sound range that the player could try to aviod adding a stealth element to the game if desired.The game will have a job/class system that is currently being developed and a complex stat system.Target aim:The aim of this game will be XNA and C# on the PC and Xbox 360. I am also planning on submitting it for the Dream Build Play contest.Compensation:Everyone will receive a fair share of the profits when the game is completed and released.Technology:XNA and c# for the PC and Xbox 360Talent needed:I currently need the following:1 or 2 2D artists. Looking for pixel art or just stylized 2D art.Team structure:Currently the team is made up of:Myself - programmerPhilip Yon (www.philipyon.com/loe) - Music and ArtBrian McCain - writerGreg Maslin - DesignerWebsite:So far I've just been creating youtube videos to document the process:Fist video showing the quad tree, agro, and initial pathfindingScripting systemUpdated Pathfinding and Combat:Weather/Particle SystemScripting and putting things togetherContacts:contact at XNARpg at gmail dot com if you are interested.Previous Work by Team:This is the first work by the teamAdditional Info:Feedback:Please leave any feedback here or on youtube.
So, can I help? ;Quote:Original post by FujiSo, can I help?Maybe if you can send some samples to Spinja in the email provided we can look at them. We could use a good pixel artist since all our art right now is non-original, and we could use someone for original tiles and character sprites since we plan on putting this on the Xbox 360 Indie/Community section of the Live Marketplace, we are getting a bit concerned about not having an artist so don't be shy Fuji.That being said, I say go for it! ; Bump, still looking for Pixel artists interested in our group. ; I have contacted that email but has not received a response. ; I would like to join.I am a 2D Artist.I use the "Wacom Intous4" for my drawings.PM me back ; Sent an E-mail. hope to hear from you.
Steps in being a programmer
GDNet Lounge;Community
After cruising this board for the last several years, as well as reflecting on my own journey as a programmer (coming up on 10 years now), I have come to the realization that many programmers take the same steps as they mature their craft. I have outlined them below as I see them. I am interested in what you all think. Did you take the same steps? Am I missing steps?Choosing A LanguageChoosing a language is often the first road-block for new programmers. With the plethora of languages available, as well as the greatly varying opinions on the best way for new programmers to learn, often beginners will get stumped at this stage while trying to figure out just how to begin. The best advice? Just dive in somewhere. No matter what, you are probably going to hit your head on the rocks.Understanding The Jargon and ToolsThe next hurdle for the new programmer is understanding the jargon and the tools that come along with programming. Variables, functions, methods, libraries, compilers, linkers, debuggers, development environments, version control software. Syntax errors. Program design and flow. Often beginners get hung up and frustrated trying to do minute things like include header files (or even figure out why they are important). The rabbit hole is steep, and very, very deep. Most of the time, new programmers just want to start by doing -- but there is a steep learning curve, especially if you are young or have never studied a related field.This Isn't As Easy As I ThoughtMany new programmers quit at this stage when they realize that this wasn't going to be quite as easy as they thought. It is a tremendous hurdle. The First Big ProgramIf a budding programmer can wrap his or her mind around the new concepts and stick with programming long enough, they will soon begin writing very small demo programs to build up their abilities. Soon, these demos begin getting bigger and bigger as the programmer begins to feel more confident. Many times the beginner will decide to tackle something too large and be knocked down. But finally, they will choose a concept of enough magnitude that it represents a large milestone in their learning, but is still achievable. If any competent programmers look at the source to this project, they normally cringe.Premature ConfidenceProgrammers who reach this state often begin going on message boards and helping out beginners. They are confident in their abilities, and begin coming up with larger and more grandiose schemes with their newfound skills. They are over-confident, and often cocky. Often they spread misinformation and bad habits to beginners. They also often begin learning a second or third language, though often don't get much further 'intellectually' in the language than they did in their first.I Can Do It MyselfThis stage follows closely after the last, and occurs when programmers gain more confidence in their programming. Often they are good enough at this point to work on larger projects, but their implementations are often poorly designed and inefficient. However, without formal critique, the programmer never knows. Often, in this stage, they begin writing more complex software, which could easily be finished by the implementation of appropriate libraries. However, in this stage, the programmer attempts to implement everything themselves. In public, they often write this off as a 'learning experience.' In private, they say it is because they don't want to learn the other software. Deep down, it is because they think they can come up with just as good a solution.While programmers in this stage can be difficult for many more mature programmers to deal with, I consider it a crucial step. Often, in this step, programmers learn vital lessons on what NOT to do, which are just as important as learning what to do. The next three steps often happen in a random order, and most often, in parallel.Understanding Computer ScienceIn this stage, programmers begin to learn that Computer Science is not Programming. They begin learning about the theoretical foundations of information and computing. They begin learning about algorithm efficiency, computational complexity, programming language theory, and many other important fields. They begin to understand how these important topics extend beyond the computer, and how programming is merely just an implementation of these ideas. They come to the realization that programming is nothing more than syntax, and with the core foundation of these ideas, it doesn't matter what language you use.Understanding Software DesignHere, programmers begin to understand how to design programs. They learn the concepts of software engineering and the software development life cycle. They focus on such topics as cohesiveness and coupling. They begin learning design patterns, and misusing them. Badly. But as time goes on, the programmer begins developing better habits.Understanding The ComputerIn this step, programmers begin to truly understand how the computer works, from the ground up. They understand the basic concepts of memory, the hard drive, the processor, networking, and the operating system. They understand cache misses and paging. They understand the trade-off between memory and speed. Most importantly, they begin to understand how programming relates to it.Mastering a Pragmatic/Academic DomainIn this stage, programmers often begin focusing on a pragmatic domain; something similar to developing software for the iPhone, or writing Windows applications. They may gain expert knowledge of a specific library or package, like SDL. They may become experts in topics such as networking or graphics. Often, these pragmatic interests become academic interests, and the programmer goes on to research subjects such as machine learning, graphics, scientific computing, software engineering, computer engineering, language design, algorithm design, parallel computing, et cetera. As an example with GDnet, we will see programmers who may be experts in OpenGL, but more importantly understand the underlying theory of graphics programming, so are able to efficiently transfer their ideas to other APIs if necessary.Being PragmaticAfter gaining domain specific knowledge, the programmer often begins using libraries designed for that field. Soon, the programmer realizes that he would be better suited by using domain specific libraries to tackle his problems all the time. This is where you see programmers begin using libraries like boost that they previously neglected. Instead of taking the time to write all the components of a 3D engine, programmers in this stage may instead simply write the glue between the appropriate libraries. Or, if they are interested in writing games, simply find the 3D engine that best suits their needs.From that last step, I don't know. I can only truthfully say I entered it in the last couple of months. But now that I am in it, I can recognize other people entering it as well. So, for all of those who are steps beyond me ... what comes next?
I dont see no missing steps but wat u gots it too linear. I started with QBASIC so I wentQBasic: The First Big Program, Premature Confidence, This Isn't As Easy As I Thought,Choosing A Language -> C++, Understanding The Jargon and Tools, The First Big Program, Premature Confidence, I Can Do It Myself, This Isn't As Easy As I Thought, I hate C++. And then I stopped programming. I came back and picked up C# 1.0 which wasnt too good. And Got Ocaml then haskell. And then:Understanding The Jargon and Tools,domain focus, The First Big Program, Understanding Computer Science, pragmatism, design. I dont really understand how Computers work. ; I think I skipped the "This isn't as easy as I thought" stage. Is that a bad thing? ; The last step is enlightenment - there is no spoon. In other words, you realize that you can actually make computers do anything, given enough time. Soon after this, you realize that in order to effectively get more time, you need to rely on other enlightened ones.By the way, most programmers I've met have written production software before they understand computer science or software design. This results in - mildly put - unmaintainable systems. ;Quote:Original post by Oberon_CommandI think I skipped the "This isn't as easy as I thought" stage. Is that a bad thing?So you're stuck at "Premature Confidence"? ;) ; I never really did the 1st two steps. My father introduced me to programming when I was about 8 on GW-BASIC, I later came across an old C book/compiler in his study and started playing with that, before getting a free Borland C++ compiler later on. I never sat down and wondered "which language do I use"... and my first expereinces with programming were on systems which had no IDE etc! ;Quote:Original post by d000hgI never really did the 1st two steps. My father introduced me to programming when I was about 8 on GW-BASIC, I later came across an old C book/compiler in his study and started playing with that, before getting a free Borland C++ compiler later on. I never sat down and wondered "which language do I use"... and my first expereinces with programming were on systems which had no IDE etc!Likewise. I started out wanting to make a web page, and was dissatisfied with the WYSIWYG editors of the late 90s, so I naturally had to learn HTML. After that, I started wanting more interactivity in my pages, so I naturally had to learn &#106avascript. Then, my parents bought me a Borland C compiler with a bunch of books for Christmas one year, so I just started reading them. In college, we were made to study C++, and then Java. C# is probably the only language I ever explicitly *chose*, and that was near the end of my college career anyway. ; I guess it was easier in my days.Quote:Original post by visageChoosing A LanguageI had no problem choosing a language since this brick only supported Basic.Quote:Understanding The Jargon and ToolsOther than primitive jumps, it did not support functions or methods. Being an interpreted language, I had no need for compilers or linkers. Debugging consisted of little more than printing to a monochrome screen. No IDE or other tools available.Quote:This Isn't As Easy As I ThoughtActually, besides learning to deal with the somewhat obscure and undocumented peek and poke commands, I didn't find it too difficult. [smile]Quote:The First Big ProgramIts lack of hard disk and its 16K internal memory weren't suited for large programs, so I think I pushed to the limits.Quote:Premature ConfidenceYou guessed it. No real message boards in the mid eighties other than BBS.;Quote:Original post by WanMasterActually, besides learning to deal with the somewhat obscure and undocumented peek and poke commands I didn't find it too difficult. Ack! I think I still have nightmares in the middle of the night about long lists of poke() commands [grin]I've wondered what it would have been like just starting out now, though, with so many choices of wonderful languages/IDEs freely available, and so many horrible programming practices never to have to unlearn. However, in a way, it was easier to get hobby projects finished on my trusty C64, since my goals were orders of magnitude more reasonable then...;Quote:Original post by RattenhirnQuote:Original post by Oberon_CommandI think I skipped the "This isn't as easy as I thought" stage. Is that a bad thing?So you're stuck at "Premature Confidence"? ;)Ouch! He handed it to you there, Oberon_Command!Are you just going to passively take that?...No, moderators, I'm not trying to start a flame war.*Gets popcorn*. [smile]
Artist Wanted
Old Archive;Archive
Team name:Blacklist (not registered)Project name:B17: Flying FortressBrief description:Shoot 'em up in the style of the retro game 1942. The project has been in development for about 3 months and is nearly ready for release.Target aim:The game runs on both PC (Vista) and Xbox 360 using XNA/C#, although it will only be released on Xbox Live Marketplace. Longer term, I plan on creating 2 more versions of this game replacing the B17 with a B24 Liberator and a B29 Superfortress. Plus, I have a good idea for a Pac-Man clone, a racing/combat game, and an RPG of sorts.Compensation:The game will be sold via Xbox Live Marketplace for $5 per copy (400 MS Points). I should receive about $3.50 per sale. I will pay 50 cents for each copy of the game purchased.Technology:XNA/C# development for PC and Xbox (all free). The artist is allowed to use any tools they find appropriate as long as it is legal and does not place a watermark or any other data that makes the images inappropriate for a commercial game.Talent needed:An artist. Only 2D artwork needed for the current project. No experience necessary, just artistic talent. An online portfolio would be great.Team structure:Bill Ulrich - Programmer and only team member at the time of posting.Website:We currently on have a blog here: blogspot.Contacts:[email protected] Work by Team:My previous game development work includes Madden 2002 (PS2, NGC, XBOX) and Peacemaker (PC, Mac).Additional Info:The game is approximately 30MB and I can email the trial PC version to anyone interested in updating the graphics. Unfortunately its an XNA game so you can't just change the images in place unless you know how to manipulate XNB files (XNA converts images to .xnb files). I do, of course, have all of the original art in PNG format.Feedback:ANY[Edited by - Bill6 on June 22, 2009 12:36:54 AM]
Because your post doesn't adhere to the mandatory posting template, it's likely to be locked pretty soon......which is why I'm IBTL. I'm interested. I logged hours of 1942 on the good ol' original NES as a kid, and anything similar sounds right up my alley. Examples of my work can found at:http://www.designbyjustinsmith.com/I haven't worked with XNA or the .xnb file format in the past, but I'm sure I can pick it up quickly enough.Feel free to send the trial PC version to: [email protected]; Thanks for the heads up. I think my post now meets the requirements, err template. ; There we go! :DLooking forward to the trial PC version. ; What kind of '2d art'? You mean hand drawn art or sprite work? ; Sprites. Additional details:Cartoon style for more of a cell-shaded look.I think the cartoon style with dark borders (and contrasts) will help differentiate between the planes, projectiles, and backgrounds.Plus, I'll need new splash screens, logos, game icon, and I believe that Microsoft requires "box art" for the upload to Xbox Live Marketplace.Thanks for the interest and forcing me to elaborate. ; Shoot me an email with the game so I can DL it and give it a shot.Here is my post http://www.gamedev.net/community/forums/topic.asp?topic_id=534513I do sprite work as well, I just haven't updated my post with any of it yet.Talk to you soon! ; Can you tell us a little more about the artwork you're looking for ( i.e characters, vehicles, settings)? Are there deadlines, and when do you expect it to be on the Xbox network? Here's my thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=538979 I'm a concept and comic artist. ; Additional Info:The sprites are mostly planes, a tank, anti-air gun, and a bunker. There are also 9 mission targets, some background images, and overlay boxes. Feel free to experiment, I'd like to see a variety of different visions and concepts. I should also elaborate that I'm looking for the sprites to be antialiased, alpha-blended, and in PNG format (with an alpha channel). The links below will probably make more sense. There is not a firm deadline of any kind. As soon I can get the artwork updated, I will submit it to Xbox Live... I'm not really sure how long it takes to be approved after that (but I'm guessing that its pretty fast).Here's a link to the current "artwork" which I made and is not good:http://www.4shared.com/file/113483154/fc505202/B17_Artwork.htmlHere's a link to the 1st of 9 mission packs:http://www.4shared.com/file/113473197/4bbcdb65/B17_Mission_0.htmlThey are borrowed from Google Earth which is why they need retraced, colored, and textured (or done from scratch) to avoid copyright infringement... although I really don't know how someone can copyright an image of the Earth.And, finally, a link to a set of installation files:http://www.4shared.com/file/113672595/57cfd4fb/B17_Installation.htmlDownload, unzip, and run setup.[Edited by - Bill6 on June 24, 2009 4:18:33 PM]; application submitted :)
typename
General and Gameplay Programming;Programming
Ive been reading more exceptional C++ by Herb Sutter, and he comments that the following code shouldn't compile due to there not being the keyword *typename* before the dependant types. Yet im running visual studio 2008, and the code that he says is incorrect seems to compile fine for me.Here is the code that he says wont compile// Example 5-2//template<typename T>class X_base{public:typedef T instantiated_type;};template<typename A, typename B>class X : public X_base<B>{public:bool operator()( const instantiated_type& i ) const{return i != instantiated_type();}// ... more stuff ...};Here is his reasoningQuote:The problem with X is that instantiated_type is meant to refer to the typedef supposedlyinherited from the base class X_base. Unfortunately, at the time the compiler parses the inlineddefinition of X<A,B>::operator()(), dependent names (again, names that depend on the templateparameters, such as the inherited X_Base:: instantiated_type) are not visible, and so thecompiler will complain that it doesn't know what instantiated_type is supposed to mean.Dependent names become visible only later, at the point where the template is actually instantiated.If you're wondering why the compiler couldn't just figure it out anyway, pretend that you're a compilerand ask yourself how you would figure out what instantiated_type means here. It's an illuminatingexercise. Bottom line: You can't figure it out because you don't know what B is yet, and whether lateron there might be a specialization for X_base that makes X_base::instantiated_typesomething unexpected—any type name, or even a member variable. In the unspecialized X_basetemplate above, X_base<T>::instantiated_type will always be T, but there's nothing preventingsomeone from changing that when specializing. For example:Here is his corrected code without using typedefs to make it clean// Example 5-2(a)://template<typename A, typename B>class X : public X_base<B>{public:bool operator()(const typename X_base<B>::instantiated_type& i) const{return i != typename X_base<B>::instantiated_type();}// ... more stuff ...};Here is the code i compiled#include <iostream>#include <string>using namespace std;template<typename T>class X_base{public:typedef T instantiated_type;};template<typename A, typename B>class X : public X_base<B>{public:bool operator()( const instantiated_type& i ) const{return i != instantiated_type();}};int main(){X<int, char> x1;if(x1('f')){cout << "Not the same\n";}else cout << "Same";getchar();}And the same goes for the following code. From what i thought i understood about using typename, it is required in the commented out places, yet it compiles fine without it.#include <iostream>#include <string>using namespace std;class A{public:typedef int _IDtype;};template <typename T>void DisplayMember(const T& in){cout << sizeof( /*typename*/ T::_IDtype);/*typename*/ T::_IDtype n;cout << n << " " << &n;}int main(){A a;DisplayMember<A>(a);getchar();}
MSVC accepts a lot of template code that isn't actually supposed to be valid. If you tried a different compiler, say gcc, you'd probably find that typename is actually needed in those places. ; If you disable "language extensions" in the compiler options, IIRC it will generate an error. ;Quote:Original post by rip-offIf you disable "language extensions" in the compiler options, IIRC it will generate an error.As of MSVC 2008, even with language extensions disabled, MSVC will still accept large amounts of code with missing typename. I don't know if this will be changed in 2010. ; Thanks. I tried as you mentioned by disabling the extensions, but my second example still worked. Why have they done this? it makes it very confusing, surely it should be a feature that you turn on, not turn off. ; Basically they did it this way because when MSVC originally implemented templates the language specification wasn't finalized.
[.net] [WinForms] Getting control from TabPage
General and Gameplay Programming;Programming
Okay, I'm really somewhat new to .NET and WinForms but I couldn't find an answer anywhere, so maybe somebody can enlighten me here...I have a TabControl that starts out with no tabpages. I also have a button, if you click it a new tab with a WebBrowser control in it is created like this:tabControl->TabPages->Add ( "tab", "Empty Tab" );WebBrowser^ webBrowser = gcnew WebBrowser ( );webBrowser->Name = "webBrowser";webBrowser->AutoSize = true;webBrowser->Dock = DockStyle::Fill;tabControl->TabPages["tab"]->Controls->Add ( webBrowser );This works fine. Now, when another event is fired I want to retrieve the WebBrowser control from the tab that is currently selected. This is what I have:WebBrowser^ webBrowser = gcnew WebBrowser ( );webBrowser = tabControl->SelectedTab->Controls["webBrowser"];I just want to retrieve that specific control but I can't seem to find any way. I know that "tabControl->SelectedTab->Controls["webBrowser"]" IS a webBrowser control at runtime (if I try to access its "text" property it crashes and tells me that WebBrowser doesn't have a "text") but I can't seem to find a way to convert that general control structure into a specific WebBrowser one. Is there a way?Any help is appreciated.
In C#, you'd do a runtime cast like this:WebBrowser webBrowser = tabControl.SelectedTab.Controls["webBrowser"] as WebBrowser;if (webBrowser != null){ ...}In C++ you have the dynamic_cast<> operator, which requires RTTI. I'd guess this is enabled by default for C++/CLI, but I have no clue whether this operator is usable with managed classes.Edit: it is usable and it's equivalent to the C# 'as' operator. ; Oh man, that was so easy, haha.I totally didn't think this was an option in C++/CLI but it works flawlessly.Thanks for the quick help![Edited by - d h k on June 25, 2009 11:28:54 AM]
Server or no server
For Beginners
Hi all,I successfully set up a server for my game. Now the idea is that the user can make the game the server or client, or just play on the local machine. Now I got the server bit to work but my code for disabling it doesn't. The following is my code for the server. I am only showing relavent parts.SocketServer in(3000,5); Socket* s=in.Accept(); unsigned ret;This waits for a connection and then carries onThen this line sends my data to the client.string sendstring="Red Move y="+y+" x="+x;s->SendLine(sendstring);ok this works ok until I want to disable ie for if I need a local game or if I am the client. The following is what I tried.if (bserver==true){ SocketServer in(3000,5); Socket* s=in.Accept(); unsigned ret;}and for the send data if (bserver==true){string sendstring="Red Move y="+y+" x="+x;s->SendLine(sendstring);}The problem is that this throws up an error in s->SendLine(sendstring); because it hasn't been defined. I thought that if the server was set to falsethen that line shouldn't be run.Anyway I was wondering if there was a way to get this to work.Asimov
Variables only last as long as the scope they're defined in. s goes away after the body of the first if-statement. ; Code between if statements is still compiled, so even if the code won't run, it's still compiled and needs to be valid. If use #ifdef rather then if, it will probably compile, but that means you have to build separated executables for server and no server version. If you want the same executable to be able to play with and without server, you need to move the definition of variable s outside the body of the if statement. ; Hi,I understand what you mean, but I still have a problem.The line that starts the listen mode is thisSocket* s=in.Accept();This also sets the variable, but if I move it outside the if statementit will wait for a client to log in to the server even if you were not intending to play a network game.I had thought about a server and client version of the game, but most games these days let you choose whether you are server or client inside the game.eg Battleship chess (Which is a great game I might add)Asimov ;Socket* s;if (bserver==true){ SocketServer in(3000,5); s=in.Accept(); unsigned ret;}and for the send dataif (bserver==true){ string sendstring="Red Move y="+y+" x="+x; s->SendLine(sendstring);}Define s outside of the if... ; Hi Trihex,After sending the last mail I thought I would be more specific.When I add the line Socket* s;out of the if statement and server is set to true, it waits for a client to connect and then my game shuts down.I have no idea why.However when server is set to false the game runs as normal.Asimov ; Hi Trihex,I take it all back your solution worked.It was I who got it wrong. I putsocket* s;outside of the if statement but what I forgot to change was this,Socket* s=in.Accept();After changing this tos=in.Accept();everything worked.Thankyou very much.My gameserver now works.Next step is to make the client work.Then to write the menu to give you the choice at the start of the game.Anyway thankyou to all that replied.Asimov ;Quote:string sendstring="Red Move y="+y+" x="+x;SendLine(sendstring);Another thing you may want to keep into consideration is bandwidth usage. I.e. use an ID number for commands and a table lookup to find what function to call.Ex:struct cmdDef {std::string cmdName;void (*cmdFunction)(Player *player, std::string args);};//command send to clientstruct clientCmdDef {std::string cmdName;std::string clientFunc;};//commands received from clientsconst struct cmdDef socketCmd [] = {{"0", testCmd},{"1", socketCmdRegister},{"2", socketCmdLogin},{"", 0}};//commands sent to clientconst struct clientCmdDef clientCmd [] ={ {"test", "0"},{"MessageBox", "1"},{"RegisterComplete", "2"},{"loadLobby", "3"},{"updatePlayerList", "4"},{"updateFriendList", "5"},{"UpdateRoomList", "6"},{"lobbyDoChat","7"},{"JoinRoom", "8"},{"UpdateRoomInfoPlayerList", "9"},{"RoomInfoDoChat", "10"},{"LaunchGame", "11"},{"GameUpdatePlayerList", "12"},{"", ""}};
Some error with a double buffering program
For Beginners
OK heres the deal...Im reading this book called "Tricks of windows game programming..." by andre lamothe (The same book which is oftenly criticised here,well i bought this book way before i joined gamedev :| )Anyways theres this program which implements double buffering (without Flip() and using memcpy)The thing is its not giving any compiler or linker errors,but when i run it a black screen appears and the following message:"This program has encountered an error and needs to close bla bla" Heres the code from the function:im using dx7 and vc++ 6int grun(){ if(KEYDOWN(VK_ESCAPE)){PostMessage(handle,WM_QUIT,0,0);} memset((void *)sec_buffer,0,640*480); for(int i = 1 ; i < 50 ; i++ ){x = rand()%640;y = rand()%480;color = rand()%256;sec_buffer[x + y*640] = color;} memset(&ddsd,0,sizeof(ddsd));ddsd.dwSize = sizeof(ddsd);if(FAILED(lpdds->Lock(NULL,&ddsd,DDLOCK_WAIT|DDLOCK_SURFACEMEMORYPTR,NULL)))return(0);prim_buffer = (UCHAR *)ddsd.lpSurface; mempitch = (int)ddsd.lPitch; if(mempitch == 640) {memcpy((void *)prim_buffer,(void *)sec_buffer,640*480);}else{for(i = 0 ; i < 480 ; i++ ){memcpy((void *)prim_buffer,(void *)sec_buffer,640);sec_buffer+= 640;prim_buffer+=mempitch;}}if(FAILED(lpdds->Unlock(NULL)))return(0);Sleep(500);return(1);}
Are you trying to learn C or C++ programming?The reason I ask is that those are functions of the C standard library. If you're using C++ it will work but it's far from safe and far from the current industry standards.If you truly want to learn Windows programming, using memory tricks like that will more than likely cause you more headaches than it's worth. Get a book on DirectX programming or GDI programming (if it's specifically for graphics).I can only assume that the code you're running is attempting to draw graphics to the screen. There are much better and far safer methods than by using direct memory calls. More over, direct memory calls like that are very much taboo on Windows platforms and are grounds for calling a program 'misbehaved'.I would recommend, if you're looking into 3D programming, that you get a book on DirectX or, if you're interested in cross-platform development, a book on OpenGL. Perhaps even a book on both. Also make sure that the book or books are current (e.g., newer than at the very earliest 2000). Technology and operating systems have changed considerably since the days of Windows '95 which is when that code may have been acceptable. ;Quote:Original post by leeor_netAre you trying to learn C or C++ programming?UM....yes and noC++(or turbo c++ to be more specific) was part of my school curriculum and i studied it for 2 years,but it was all text based with no emphasis on graphicsI am learning windows programming and directx from the book "tricks of the windows game programming gurus" by andre lamothe and the preceding code was taken from there,this is more like a test program rather than an implementation... thanks for the reply though...i didnt know programs could misbehave :) ; Yep. They very much can. Windows, by nature, doesn't allow direct access to the hardware. By not using a function like Flip() (I'm not terribly familiar with DirectX, I tend to use cross-platform solutions instead like SDL, OpenGL and OpenAL) and instead using a direct memory access, who knows what could happen. You probably don't know the exact pixel format and working with memory like that is very dangerous (in terms of program stability). In the past, doing such a thing on Windows '95 may have worked but virtually garanteed a system lockup should there be bugs. Not to mention, trying to do direct memory accesses is very error-prone.I would say the book is trying to illustrate a point but it's been my experience that using 'clever tricks' is vulnerable to bugginess and is a maintenance nightmare.As for misbehaving programs, this is basically a program running under an OS that doesn't do what the OS expects. For instance, requesting a Device Context but never freeing it virtually garantees a crash. Like I said earlier, on Win'95 this would bring the OS to its knees but XP/Vista/Win7 handle this much more gracefully.Another way of misbehaving is not responding to Window Messages (e.g., filling the windproc() function with code that responds to WM_ events). This is when you get a 'Program not responding' problem. Modern version of windows handle this very well but those of us who've been around awhile may remember the smearing that happened when a program stopped responding on Windows '95 often followed with a BSOD of some sort.Yet anothe way is not sharing resources. If your program goes out of focus, you need to release device contexts. Not doing so can cause all sorts of problems and Windows will often shut down a program that refuses to share its resources.The list goes on and on but my suggestion is to be very careful with any 'tricks of the trade' because they can be much more trouble than they're worth if you're not 100% sure exactly what the code does. ; Hurrah!Found the answer..."C++ does not protect you from your own stupidity"is what someone wrote here at gamedev and that was it....it Turns out i wasnt allocating memory for a pointer i was using (the sec_buffer)How massively stupid!!Anyways thanks to you,leeor net for sparing time for a newbie like me...Really helpful post about menacing programs :) ;Quote:Original post by leeor_netWindows, by nature, doesn't allow direct access to the hardware. By not using a function like Flip() (I'm not terribly familiar with DirectX, I tend to use cross-platform solutions instead like SDL, OpenGL and OpenAL) and instead using a direct memory access, who knows what could happen.True, but just to clarify, when you Lock() a DirectDraw surface, its memory is copied (or behaves as if copied) into system memory so it can be accessed like normal. When you Unlock() it, it is (probably) copied back into video memory. You are quite right about the pitfalls, but LaMothe is not actually accessing video memory directly in the code above.Manpreet - I can't comment directly on the book as I haven't read it, but I would point out that DirectDraw is horribly out of date and had a nasty interface anyway. It was deprecated by Microsoft when DX8 came out and you'd be far better to skip DirectDraw, find some resources about doing 2D games with Direct3D and starting from there.[opinion]I have heard of the book and wonder why the author considers implementing your own page flipping with memcpy() a trick of a guru but that is far less of an issue than its age.Learning about page flipping by writing a program to simulate it is a bit like crossing a swimming pool in a barrel to learn about Columbus' discovery of America. If you want to know more about page flipping, just read about it then let your graphics API and the hardware do it for you. [smile]
Terrain editor (height maps)
For Beginners
I put this in the beginner section but I have messed with 3D graphics some and have been coding in C++ for years. But I have never created a game at all. I have tons of books but my question is I want to create a map editor kind of like Far Cry 2's map editor. Is there anywhere to find info on doing this. I have a book on height maps but I don't think it is exactly like I want although I will use it as reference. I want to be able to add buildings and other items as well. Real time shadow rendering. Ability to build caves into the mountains(height map) or extend the height map horizontally as well. I just need pointed to a good reference. Any ideas or examples out there would be cool too. Thanks in advance.jack
Creating a map editor like that is far more complex than you might imagine.First and foremost you'd need to decide how to handle terrain. When thinking about a popular 3D game with a built-in editor, Warcraft III comes to mind. I don't know how exactly they handle the maps internally but if I were to implement it I'd use a height field as it's very simple to work with.Buildings and trees are simply objects. If you think about how a height-field is constructed it could very easily be devided up along a gride. This grid, in effect, devides the map into 'tiles' or 'cells'. You could align buildings and objects to these cells using a vertex offset of some sort.Building caves into a mountain isn't really that possible with height fields... not directly at least. I would image the easiest way to do this would be to have a separate cave mesh that you 'insert' into the heightfield. In order to get it to look right you'd need to remove polygons out of the height-field where the cave and the height-field meet. I'm sure there are other approaches to this but that's just off the top of my head.Adjusting heights in a height field is also very simple -- just increase or decrease the Y value of any particular vertx and viola, height has been adjusted. To do this with a mouse is a simple matter of using a technique like a mouse ray-cast (e.g., casting a ray at from the camera using the mouse position on the screen as a starting point and seeing what geometry said ray collides with).Another possibility is to not use height fields at all and instead use a full 3D mesh for landscape. This is a much more complex method for creating terrains and would require a considerable amount of time spent developing the tools for it but it's a valid approach.I haven't looked for any references in particular but google is good for that sort of thing.Ultimately you're going to be looking into not one but many different approaches and methods to do specific things and then tying all of them together to build an editor.Hope this helps. Good luck! ; Well I don't think making a simple terrain editor is too hard as the height map is concerned but I agree that some of the stuff I listed will be hard. Like the caves I knew would be hard but your idea was pretty good. I know on the CryEngine2 you can just click a mouse button and dig through mountains on your height map. I don't know how they achieve this and I know it's a multi million dollar engine as well. But thanks for getting my mind working now. I appreciate your post. I may have questions for you later. Have a great day.Jack ; Actually implementing a simple heightmap editor is not that hard, with strong focus on simple. But if you progress some more you will soon find that difficulties arise in two major categories. First, you need some capable tools to edit your terrain which involves all sorts of picking, transformation, and similiar operations you need to have in your 3D engine. Second, the editor is only of use if you have a writable (and obviously readable as well) file format you can work with.The second category involves even more: When working with large terrains you would need to have a strong terrain rendering implementation in your editor already. Basically, all of your terrain rendering, hierarchical organization, terrain patch streaming and culling code and so on has to be implemented. So I guess that is why you get posts telling you it ain't that easy. Especially when you throw up buzz tools like the Far Cry 2 editor [smile] ;Quote:So I guess that is why you get posts telling you it ain't that easy. Especially when you throw up buzz tools like the Far Cry 2 editorYou are misquoting me. I never said it wasn't hard. All I said is the height map editor in it's basic form shouldn't be too hard. I agree with all leeornet said I didn't say he was wrong when he said it would be hard in fact a agreed with him. As for the "buzzword" Far Cry 2 map editor I was just wanting him to know what I was going for in a way. I said that cause I knew I would get replies about using photoshop or paint or something which is not what I want to do.Let me ask this though, should I make my own file format for this idea. I'm just jotting down ideas on paper right now. I know when I start adding objects like buildings and trees, and textures it gets way more complicated. But if I fail I fail what have I lost? Nothing. I learn and move on. Thanks for the post too. ; You could do something similar to how the Torque Game Engine works. Save your height field out as a separate file and then use a level format similar to the following:new SimGroup(MissionGroup) { canSaveDynamicFields = "1"; Enabled = "1"; cdTrack = "2"; CTF_scoreLimit = "5"; musicTrack = "lush"; new ScriptObject(MissionInfo) { canSaveDynamicFields = "1"; Enabled = "1"; desc0 = "Humans have found your preliminary Core. This outpost is crucial to our development."; TypeS32 descLines = "2"; name = "Mission 1"; }; new MissionArea(MissionAreaObject) { canSaveDynamicFields = "1"; Enabled = "1"; Area = "-360 -648 720 1296"; flightCeiling = "300"; flightCeilingRange = "20"; TypeBool locked = "true"; }; new Sky(SkyObject) { canSaveDynamicFields = "1"; Enabled = "1"; position = "0 0 0"; rotation = "1 0 0 0"; scale = "1 1 1"; materialList = "scriptsAndAssets/data/skies/sky_skybox.dml"; cloudHeightPer[0] = "0.349971"; cloudHeightPer[1] = "0.3"; cloudHeightPer[2] = "0.199973"; cloudSpeed1 = "0.0005"; cloudSpeed2 = "0.001"; cloudSpeed3 = "0.0003"; visibleDistance = "500"; fogDistance = "500"; fogColor = "1 1 1 1"; fogStorm1 = "0"; fogStorm2 = "0"; fogStorm3 = "0"; fogVolume1 = "0 0 0"; fogVolume2 = "0 0 0"; fogVolume3 = "0 0 0"; windVelocity = "1 1 0"; SkySolidColor = "0.113 0.148 0.215 0"; useSkyTextures = "1"; renderBottomTexture = "1"; noRenderBans = "0"; renderBanOffsetHeight = "10"; skyGlow = "0"; skyGlowColor = "0 0 0 0"; TypeBool locked = "true"; windEffectPrecipitation = "1"; }; new Sun() { canSaveDynamicFields = "1"; Enabled = "1"; azimuth = "0"; elevation = "30"; color = "1 1 0.8 1"; ambient = "0.4 0.4 0.5 1"; bloomAmount = "0.3"; bloomCutOff = "0.8"; bloomSeedAmount = "0.5"; castsShadows = "1"; direction = "0 0.954268 -0.298953"; DRLHighDynamicRange = "0"; DRLMax = "1"; DRLMin = "0.5"; DRLMultiplier = "0.9"; DRLTarget = "0.6"; TypeBool locked = "true"; position = "0 0 0"; rotation = "1 0 0 0"; scale = "1 1 1"; useBloom = "0"; useDynamicRangeLighting = "0"; useToneMapping = "0"; }; new TerrainBlock(Terrain) { canSaveDynamicFields = "1"; Enabled = "1"; position = "-1024 -1024 0"; rotation = "1 0 0 0"; scale = "1 1 1"; detailTexture = "scriptsAndAssets/data/terrains/details/detail1"; terrainFile = "scriptsAndAssets/data/missions/1_0.ter"; squareSize = "8"; tile = "0"; detailDistance = "25"; detailScale = "256"; detailBrightness = "1"; texelsPerMeter = "8"; clipMapSizeLog2 = "10"; bumpOffset = "0.01"; bumpScale = "1"; TypeBool locked = "true"; zeroBumpScale = "8"; };ect, ect...
changing texture gain and offset on the fly
Graphics and GPU Programming;Programming
Hi, Is there any way to change the texture gain and offset after the texture is generated, as opposed to regenerating the texture?I am currently generating the texture as follows: glPixelTransferf(GL_RED_SCALE, 65536.0f/max); glPixelTransferf(GL_GREEN_SCALE, 65536.0f/max); glPixelTransferf(GL_BLUE_SCALE, 65536.0f/max); glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE16, pImage->Width(), pImage->Length(), 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, pImage->GetPtr(0));but I would like to dynamically change the gain while drawing instead. Thanks,WF
You could use material properties to modulate the color.MaterialColor * TextureColor.This wont provide you any offsets though. Unless you mean textue coordinate offsets, then you could use a texture matrix.I would suggest you use shaders for this. Then it'd be very easy to setup outColor = colorOffset + texColor * colorScale; ;Quote:Original post by bzroomYou could use material properties to modulate the color.MaterialColor * TextureColor.This wont provide you any offsets though. Unless you mean textue coordinate offsets, then you could use a texture matrix.I would suggest you use shaders for this. Then it'd be very easy to setup outColor = colorOffset + texColor * colorScale;Thanks bzroom. I'm afraid I'll have to learn to make a simple shader, trying as I have been to avoid it. Once I learn, I'm sure the benefits will outweigh any added complexity. Do you have any links to an ultra simple shader tutorial that would get me going? Thanks,WF ; Sure:http://www.lighthouse3d.com/opengl/glsl/
Move from one 2D point to another, with acceleration
General and Gameplay Programming;Programming
Say you have one point on the circumference of a circle and you have to draw a dot moving alongside that point to the center of the circle. Now you want the dot to move faster as it gets closer to the center of the circle. Could somebody please explain to me how I can plot the point and how I can work it all out please?
Subtracting the 2D point from the circle's circle will give you a vector representing the distance between the 2D point and the circle's center.The magnitude of that vector will tell you how far away the 2D point is from the center of the circle.Normalizing that vector will give you a general direction vector.Knowing the distance between the point and the circle and the direction, you should be able to apply some force to the point's velocity.Does this help? ; You need to keep track of the speed the dot is moving at, and increase that speed each time you move it. For example:float position = 0.0f;float speed = 0.0f;float acceleration = 1.0f;while(running simulation) { position += speed; speed += acceleration;}This way 'position' will move accelerated. Your probably also want to multiply each addition with the time since the last iteration, unless you want to run it only once per second, which won't give very accurate results. So something like the following, if you run it 100 times per second:float time = 0.01f;float position = 0.0f;float speed = 0.0f;float acceleration = 1.0f;while(running simulation) { position += speed * time; speed += acceleration * time;}Plotting the point is a whole different matter, and requires that you have some way of drawing graphics.