Jump to content

  • Log In with Google      Sign In   
  • Create Account

Khatharr

Member Since 24 Apr 2010
Offline Last Active Private

#5311707 Need help with Game Maker

Posted by on 20 September 2016 - 06:25 PM

Well, you could use the free version, or you can...

 

http://www.yoyogames.com/get

 

f384008ea9.png

 

I believe that they prefer each user to have an account, so honestly I'd just go with the free version unless you really need to publish to alternate platforms or something.




#5311705 Why C# all of a sudden?

Posted by on 20 September 2016 - 06:19 PM

C# applications will even outperform C++ aplications 90% of time

 

xftyHLD.gif




#5311703 Two classes relying on each other

Posted by on 20 September 2016 - 06:15 PM

I need the address of the owner so that the owner can delete the bullet from memory - unless there's some other way I could do it?

 
The shooter does not need to own the bullets once they're fired. You can have an external container that holds bullets and deals with their logic independently.

class ScaryMonster {
public:

private:
  void immaShootDisFoo(SimpleScene& myParentScene) {
    myParentScene.spawnBullet(allKindsOfArgs);
  }

};

class SimpleScene {
public:
  void spawnBullet(location, direction, speed, etc) {
    bullets.emplace_back(bullet constructor arguments);
  }

  void updateBullets() {
    for(auto& bullet : bullets) { bullet.update(); }
    bullets.erase(std::remove_if(bullet.begin(), bullet.end(), [](Bullet& b) { return b.isDead; }) bullet.end());
  }

  //...

private:
  ScaryMonster blerg;
  std::vector<Bullet> bullets;
  ShinyHero derp;

};



#5311701 Inserting element into vector during iteration causes crash

Posted by on 20 September 2016 - 06:04 PM

I thought this sort of thing would be quite common in C++ so am surprised at this behavior!

 
Documentation of std::vector will point out that element insertion invalidates iterators.

 

It looks like this vector is a primary owner for these objects. If you can ensure that the vector outlives anything that may refer to its contents then you could just use std::vector<Test1> and then take references to elements or (preferably) simply refer to them directly as needed. If you're thinking about polymorphism then that won't work though.




#5311115 How many RAM on VDS server I need setup, then my fb game will support 1000 on...

Posted by on 16 September 2016 - 01:20 PM

640K of memory should be enough for anybody.

 

Have you made Pong yet?




#5311113 My Dream World

Posted by on 16 September 2016 - 01:16 PM

Yeah, I had to move some drives around for it. Longcard is long.




#5310011 Platformer style tutorial. How to import files from tiled etc?

Posted by on 08 September 2016 - 02:31 PM

Sounds like you have a list of individual topics to study. This is also one of the disciplines of programming (research). Trying to find the all-in-one guide is going to cause you more problems than it solves (even if you do find a guide claiming to be this thing).

 

It sounds like your initial research has led you to a list of things to study more deeply, so the next step is to research each of those topics individually. Continue this process recursively until you understand all that you need to do.

 

As for loading from tiled specifically, there are libraries available for this. A quick google search found me one for snek.

 

 




#5309890 Computer understands your text and is able to speak back

Posted by on 07 September 2016 - 07:00 PM

NLP is a very hard and broad field. It has been around for decades and touches on some of the most advanced research in applied computer science. Throwing that away and pretending you can do better than the accumulated expertise of hundreds (if not thousands) of brilliant people, just because you "dreamed the code", is not healthy.

 

There is no tutor more capable than failure.




#5309639 SFML converting local object coordinates to global coordinates

Posted by on 06 September 2016 - 04:15 AM

If you're going to scale and rotate as well then you'll need to get familiar with transformation matrices. Most of what you'll find on the subject deals with 3D spaces, but the concept is the same either way. The transform is stored as an N+1 (N being dimensions) matrix that holds the information about the position, orientation, and scale of the object. You multiply each vertex by the matrix to place the object in the world space.

This sounds very complicated, and indeed the math takes a little while to learn, but SFML has the sf::Transform class that can help you work with it.

You'll still want to familiarize yourself with what's going on though, as these operations are the very core of what drives modern renderers, and they're also widely used in physics. There are a ton of resources for learning linear algebra around the internet, as well as for transforms in particular. If you have some time on your hands I recommend MFGD:

https://youtube.com/playlist?list=PLW3Zl3wyJwWOpdhYedlD-yCB7WQoHf-My

But you can also find videos from KhanAcademy and various others just by searching "introduction to transform matrices".


#5309577 SFML converting local object coordinates to global coordinates

Posted by on 05 September 2016 - 07:26 PM

Add the position of the origin to the vertex offset. In your example the world space location of V1 is X + V1. sf::Vector<T> has math operators defines, so something like:

auto worldCoordV1 = triangle.position + triangle.vertices[1];

can work just fine.

 

Note that if you start involving rotation and scaling then you'll need to account for the whole transform instead of only the translation. What you're really doing here is applying the same transform to each vertex. Generally geometry instances are stored as a collection of vertices (the shape) paired with a transform (the position/scale/rotation). You don't need to have a specific vertex to serve as the origin of the model space.




#5309430 How to design my collision code properly?

Posted by on 04 September 2016 - 03:19 PM

__SKYe got it exactly, and this is an excellent example of why to prefer composition over inheritance.

 

All I'd add is that you'll probably want to also write some inline functions for reverse order tests:

 

ret_type check_collision(A& a, B& b) { /* code */ }

inline ret_type check_collision(B& b, A& a) { return check_collision(a, b); }

 

And also look for other places where you can delegate. For example, sphere v sphere can be delegated to sphere v point.

 

The composition approach also makes it easy to create composites, where you have a collection of collision primitives wrapped in an object that allows them behave as a single collider.




#5309292 Faster Sin and Cos

Posted by on 03 September 2016 - 06:06 AM

What's the critical path? (I'm far too lazy rn.) There's a lot of parallelizable multiplication there. If it's flooding the available multipliers then it's likely that near future hardware (with more mul units) will give a greater improvement.

...

How many multipliers do modern cores have now anyway? Or are FPUs monolithic?


#5309260 My Dream World

Posted by on 02 September 2016 - 09:12 PM

Spec sheet says, "Support for 2 PCI Express x16 Gen 2 graphics cards up to 150W."

 

Mine is plugged into a 2.0 slot (same kind as yours) and it does just fine running a 1080p monitor and a 1280x1024 on the side. It's not providing the full speed advantage from the card, but it's close to the best performance available for the slot type. If and when I upgrade my board I can switch to a 3.0 slot and get the added performance advantage from the card automatically. (I've seen some people say that 2.0 is fast enough for any existing card, but I don't know enough about it to be able to confirm or deny that. I only know that my card does what I need it to do without complaining.)

 

Your mobo is likely to be your next bottleneck for everything. That board apparently has an LGA1366 socket, so upgrading the CPU could be really expensive. The board is EATX form factor, which is kind of a pain in the butt (it's not a common form factor) and limits your upgrade paths. I can't find any information about whether or not your case would be able to mount a standard ATX-sized board, but if it does then it would definitely open a lot of doors for you.

 

That said, if you find - some time in the future - that you want more performance, then you can poke around here and ask about the best way to proceed. It's a lot cheaper to custom build or to replace parts than it is to buy prefab boxes.




#5309255 Faster Sin and Cos

Posted by on 02 September 2016 - 08:29 PM

Someone put this blanket in the dryer.




#5309241 My Dream World

Posted by on 02 September 2016 - 06:04 PM

What's the make/model of your motherboard?






PARTNERS