• Content count

  • Joined

  • Last visited

Community Reputation

140 Neutral

About Sappharos

  • Rank
  1. A question for someone with a more mathematical mind. When drawing a circle on the screen using vector graphics, is there a way to calculate how many vertices should used given a specific radius, to make it appear smooth (pixel-level accuracy)? This will be less given a smaller radius, but it appears it's not directly proportional to the radius or circumference. Thanks, Matthew Rule
  2. Comp Sci Portfolio

    I have a few questions about managing my project page. Link: [url=""][/url] Sure it's useful to show off to my friends, or transfer files to other computers to see if they run; but an employer for example would not be interested in it. Are there any opportunities at all in maintaining/improving this site? How do I make it more interesting? I have a few ideas: - Make bigger or more complete projects. There are ways to scale up each of the projects here. - Add Java applets; small games or demos. - Change my style of writing. Finally, is it a bad idea to put my full name there?
  3. Patent Violation?

    Occasionally while researching means to an end, you stumble across something like this: a [url=""]patented algorithm[/url]. This applies to the following: [url=""]http://en.wikipedia..../Marching_cubes[/url]. So, logical methods can be copyrighted; flagged as someone else's territory. The only efficient way to do something turns out to be illegal in itself. And what's more, in the final paragraph: "[i]While the invention has been described in detail herein in accord with certain preferred embodiments thereof, many modifications and changes therein may be effected by those skilled in the art. Accordingly, it is intended by the appended claims to cover all such modifications and changes as fall within the true spirit and scope of the invention.[/i]" I have a few questions: 1) How likely is it that the owner of the patent will sue a popular company which uses a patented method, or an obscure company which uses it? 2) How much damage can a successful claim on their part do? Thanks, Matthew Rule
  4. 2d Skeletal Animation system

    Check out [url=""]this thread[/url] - I attempted a 2D skeletal animation a month or so ago. Here are videos of its progress at various stages, in order from earliest to latest: The end result (as far as I got) was pretty pleasing, but if you look at the earlier videos it might be easier to see how it was structured. Basically I used sine waves to determine the current position of each joint, relative to its parent. Eventually I lost motivation because I realised the easiest way to progress would be to start again with 3D vectors, even if they were drawn in 2D. Depending on how sophisticated your animation is you might want to do the same. Consider the order in which body parts are drawn, especially if there is a turning animation.

    I would argue though that with the right sort of motivation, with years of hard (but sometimes enjoyable) work, you can become a valuable, experienced individual and work as part of a team on game projects, maybe even an MMO. Yes, when it comes to very small projects, just do it. If you fail, you've still learned something.

    Please read this carefully, don't waste the time I put into this post. Stop. Think before you run out into the road. You are obsessing about this project. You are deluded. It's natural, though. A lot of programmers are driven to make an MMO when they are new to the games industry. Dammit, I still am. Guess that means I'm still new. But I like to think my viewpoint is slightly more realistic. There are people here in this forum who have worked on major game titles. Some of them are more creative, more intelligent. They have years of experience thinking the same thoughts as you, and being just as driven. Don't just throw away their advice, they have been where you are and can look back and see all the wasted motivation. To see the sort of scale the project you're working on, read the credits for WoW. Go on, read them. Yes, 10-20 minutes of different names sliding rapidly up the screen. Many different roles. A lot of these people worked full time for the years it took to make the game. Consider what sort of money it would take to pay their wages. No, you can't. No single person can imagine it. This was funded by a company which already had years of experience making games. If you go ahead with this project, you will be fighting for several months, then eventually lose interest or crash and burn, seriously demoralised. Your task is impossible. Probability of completion is a nice round 0. Just don't do it. Oh and you probably won't get permission from the Bleach guys anyway. If you just publish your work regardless you can find yourself in an actual jail cell, with a solid door. Or your parents will be mad at having to pay thousands or tens of thousands in damages. Apologies for being blunt, direct, and patronising, hopefully you'll get the point.
  7. Components / Spatial Graph

    [quote name='Burnt_Fyr' timestamp='1320948686' post='4882675'] I'm still working towards a component based design, so YMMV, but I opted to have a single spatial component, per object, which is handled by a spatial subsystem. what has really tripped me up so far is how something common to many components, like position, should be handled. So far my idea has been that components hold no data of their own, only functions. the data is stored in kv map of belonging to the entity as generic data. this way the entity has no original data(or unused data) only what has been added to it's map via it's components. I've not reached the light at the end of the tunnel, but this has definitely been my most reusable attempt so far. [/quote] Well this is certainly an interesting approach. It seems like the polar opposite to mine because my components hold no functions, only data (virtually all component processing is handled by the subsystems). I'm currently wondering whether it would be feasible or practical for each subsystem to hold its own [s]scene[/s] spatial graph. Perhaps this would only be necessary for certain subsystems.
  8. These are issues that stumped me a while ago - they were the final straw for me to abandon the project I was working on. I'm looking at it again now with a fresher brain. When implementing a component-based entity system along with spatial subdivision, is a whole seperate spatial graph required for each component subsystem, or are there other approaches? Won't this result in such a decrease in performance as to make each spatial graph useless anyway? And is it okay for the components to be very fine-grained? My current system is about as fine as you can get, as I really dislike the idea of having any entities containing unused variables. Thanks, Matthew Rule
  9. [quote name='Kyall' timestamp='1320630534' post='4881234'] You might be able to get your torso rotation if you use a scaling transform for the torso and some cleverly made graphics that include masking. So basically you create a torso art asset that can be masked and scaled and play around with the mask and scale till you achieve the result you want. If your mask is the torso then think of the position of the graphic that fills that mask as being like a spherical map that stretches around the torso. That might actually work by itself. Actually, just watching your second vid, that looks pretty slick, you just have to texture it right to hide the clothes pegginess of it [/quote] Thanks for the reply. I got a bit confused though. A spherical map that stretches around the torso? Spheres are 3D, and my character is, well... just polygons moving relative to each other according to sine waves. Are you referring to a texture wrapped around like a skin for a 3D model, to make the torso rotation more visible from the side? This is only meant to be a 2D animation, using vectors for all graphics (i.e. no textures or art assets). I've found this allows me to scale and tweak variables more easily. Perhaps I'm taking a naïve approach though, or you have an applicable suggestion which I just don't understand. The main reason for this post is that the current bone / joint structure clearly can't do everything (consider the neck, or the palms of the hands, or the ribs). I'm looking for ways to pad it out, and to draw the outside edges of the geometry only. I should have clarified that in the OP, will modify it now.
  10. Thanks for pointing that out, I'm looking for things like that. Latest revision: [media][/media]
  11. I've made a 2D running animation in C++ and OpenGL, using joints (vectors) which rotate relative to each other according to sine waves, and bones which exist purely visually between joints. You could even call it an "implementation of forward kinematics"... Here's the video of the project at its current stage. There are also links to previous versions in the description, if you're interested. [center][media][/media] [/center] Now the question is, how to proceed? I want to turn this into an animated female character for a game, moving towards Adventure Quest / Dragon Fable style. Different animations are not a problem, but I'm looking for ways to represent different parts of the character using vectors, and draw them without the use of textures. Any suggestions relating to any aspect of the animation will be appreciated. - The main reason for this post is that the current bone / joint structure clearly can't do everything (consider the neck, or the palms of the hands, or the ribs). How can it be padded out? - How do I draw the outside edges of the geometry only? - Any other ways to improve the graphics? I will follow this thread at least until it drops off the first page of the forum, so don't feel that an answer would come too late to be of any use. Thanks, Matthew Rule
  12. Well I'm confused at such complicated behaviour in what should be a relatively simple problem. For what it's worth, here's a perfectly working function, copy-pasted out of one of my projects, compliant with the Wikipedia chart I linked earlier: [source lang="cpp"] // returns a vector of magnitude 1 using the specified angle // cos is always used for x, sin for y // 0 degrees faces right, 90 faces up, etc Vector2 VectorFromAngle(float degrees) { return Vector2(cos(DegToRad(degrees)), sin(DegToRad(degrees))); } [/source] Vector2 is a class representing a 2D vector - it just contains x and y float values. It should be useful - just don't change it or I can't guarantee anything!
  13. I think at this stage you just have to keep asking questions. Break it down as far as you can. I personally don't like the approach of just randomly changing things until it looks right. - Are you sure objects are [b]drawn[/b] on screen with the correct translation and rotation? - Does the position respond correctly to velocity? - Did converting to radians make things better or worse (i.e. is the angle of movement clearly related to the direction it's facing in now, or not? Was it before?)? - Does the angle of movement (relative to the direction the object is facing in) change? You should also isolate the errors into individual key responses, and individual axes. - Does trying to rotate left modify the direction correctly? If not, what relationship does the resulting rotation have with the desired one? Is it mirrored along one axis? Both axes? Mirrored and rotated by a 90° angle? No clear relationship? - Does trying to rotate right modify the direction correctly? - Does trying to move forward modify the [b]x[/b] position correctly according to the direction? - Does trying to move forward modify the [b]y[/b] position correctly? Ask yourself these questions, and change one thing at a time, observing each individual result - don't change stuff randomly or you'll have to consider them all over again.
  14. Unity Managing Game Entities

    [quote name='KeyGames' timestamp='1315253388' post='4857942'] I created classes for physics objects, but I think it could use some more optimization and cleaning up. One thing I don't like is the GetType() method and the types string comparison stuff. The code for updating, input, drawing, and other stuff for collisions is: [code]void World::OnContactBegin(b2Contact* pContact) { void* userDataA = pContact->GetFixtureA()->GetUserData(); void* userDataB = pContact->GetFixtureB()->GetUserData(); PhysicsEntity* entityA = static_cast<PhysicsEntity*>(userDataA); PhysicsEntity* entityB = static_cast<PhysicsEntity*>(userDataB); if(entityA->GetType() == "PhysicsEntity" && entityB->GetType() == "PhysicsEntity") { if(a) entA->OnContactBegin(entB); if(b) entB->OnContactBegin(entA); } }[/code] I have a class called Entity which contains the positions and sizes of the objects, a class called PhysicsEntity which inherits Entity and contains the box2d physics stuff, and a class World which contains the world simulation. This method calls all of the OnContactBegin() functions inside PhysicsEntity. If you want the full code for all of these classes to help me then I'd be happy to share it. The thing I don't like is calling GetType() == "PhysicsEntity", each entity has a string type assigned to it and I assign it through the constructor of Entity(), and Entity has a GetType() method to return the string containing its class type, and it feels hacky to me and I'm wondering if there is a better way to do it. Anyone willing to help me further optimize my entity management system please respond! Thanks [/quote] At the very least you'll want to use numerical constants instead of strings. So use const int PHYSICS_ENTITY = 5 (or whatever); change the return type of GetType() and then test if(entityA->GetType() == PHYSICS_ENTITY... That way you're not doing array comparisons for each entity.
  15. [quote name='tom_mai78101' timestamp='1315220856' post='4857775'] Thanks for letting me know. Now, the Player object is going diagonally, but lost its ability to go forward/backward, etc. And if kept spinning around, it will go in a Simple Harmonic Circle. Updated Source: [] [/quote] So when you press forward it moves diagonally relative to the angle it's facing in? Are you using (pseudocode): x += cos(DegToRad(angle)) * velocity; y += sin(DegToRad(angle)) * velocity; These should give correct movement if the angles are the same as on here (i.e. 0 degrees is positive x and 90 degrees is positive y): [url=""]http://upload.wikime..._Conversion.svg[/url]