WoW Style Addon Implementation - c++

I am looking for any open source implementations that allow for a creation of rendered objects like World of Warcrafts addon system. I am interested in recreating something similar in my own projects that make use of Direct3D8 and Direct3D9 but have not seen any similar projects to what WoW's addon system can handle.
I have a home-brewed method that can do partially what WoW does but nothing anywhere close to as advanced as their system(s).
Attempting to Google anything WoW related with programming gives nothing useful but addon websites for the game itself and nothing towards open source things for use in other projects.
The current method I am doing is by using primitive objects rendered via vertices and allowing sprites to override the primitive and be rendered instead. As-is, I can create UI elements like this:
This is made up of 6 different 'objects' that parent to one another.
Another example would be:
This one is made up of 3 objects, with two being overridden with a sprite.
I'm interested in seeing similar projects to compare and learn from to extend my system or start a new one from the ground up with better implementation ideas in mind.

Related

Integrate UWP XAML with D3D11 Renderer

As a little side project, I thought I'd take a look at creating a simple 3D application. I'm reasonably comfortable creating WPF applications, so the Visual Studio 'DirectX 11 and XAML App (UWP)' caught my eye. It should be mentioned that I am slowly working my way through the canonical book on D3D11, '3D Game Programming with with DirectX 11' by Frank Luna.
Thus, my comfort zone with D3D11 is quite narrow, but I felt confident enough to tackle a simple task. I fell at the first hurdle. What I was trying to do is take the Visual Studio template, add simple UI of a few text boxes to view and edit the model transform.
I came unstuck with how to connect my ViewModel for the UI with my C++/CX object that contains the 3d model, and thus the model transform. My class that defines the property of the 3dmodel is a standard C++ class. I don't seem to to be able to grasp how to marry the two together.
All the tutorials out there that I've come across leave out the most important part of XAML/D3D11 integration and that is data binding to the game/scene objects themselves.
So, the question: How do I tackle the task of bridging the gulf between my C++/CX ViewModel and C++ game objects?
It is just typical that after I post the question that I find direction towards an answer.
Microsoft in their Windows Universal Samples, has a sample 'Simple3DGameXaml'. It does use Xaml, but doesn't use controls and bind to them to game objects.
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Simple3DGameXaml
However, it does show an alternative layout of the application that completely removes the confusion I had with connecting two seemingly different parts of the application.
Thanks.

Alter the appearance of NPC player entities to have a specific skin

I'm creating a bukkit plugin that's making a world in Minecraft outside the ordinary and that includes having NPCs (bots) entities that look like actually players and not villagers. I've already got the bots working programming wise but I want to have each bot have a different skin based upon it's name. Can I do this with maybe a resource pack or something? currently they take the names of Minecraft players with the same name but I'd like to override this.
TL;DR
Can I change the appearance of player entities by name with:
a Resourcepack?
a server side command?
playerConnection.sendPacket?
This is currently not possible without modifications to the client. If you want to, you can use Spoutcraft, but this requires users of the plugin to have the Spoutcraft launcher for the textures to show correctly.
There's no way to do this with the vanilla client, however, short of buying a bunch of Minecraft accounts and assigning them appropriate skins.
You should try out the DisguiseCraft plugin for a quick fix. DisguiseCraft is currently available on the Bukkit website. Do keep in mind that it also requires ProtocolLib to function properly, and you will need to have both installed on your server. You may find a link for ProtocolLib through the DisguiseCraft page. I currently use the two on my server and have had no issues with functionality.
If you would prefer a more direct approach however, since you are coding your own plugin, consider looking over the Lib's Disguises Developer API. Like DisguiseCraft, it too requires ProtocolLib, but the source for Lib's is publicly available and is intended to target developers. Just like DisguiseCraft, you may find a link for ProtocolLib through the Lib's page.

Node graph editor layout algorithm

I'm very much trying to do what was asked here:
http://www.qtcentre.org/threads/45028-Designing-a-Node-Editor-(Hint-Blender-Node-Editor)
Which is basically a blender style node editor using Qt. Creating rects with circles which can be drag/dropped is fairly simple to figure out (see the image below).
The issue I have is how the algorithm for connecting the circles between nodes would work. Also I don't know how this could be drawn efficiently using QGraphicsItem API's? I have seen QPainter::cubicTo() which looks like it may be the way to go?
I assume it somehow manages to find a none overlapping path? But it must also handle the case where it has to overlap?
And what about the user being able to move these lines around in case the algorithm has done a bad job? I don't think this would be simple to implement using QPainter::cubicTo() as you could only move the curves control points?
I don't think you'll get anyone posting the code for doing the whole lot here.
Well, I volunteer -- just in case someone still needs such a library.
It is a Qt-based node editor implemented on top of QGraphicsView.
A library consumer defines data models, the rest is done by the node editor.
Some features:
Model-view approach.
Models describe data types, number of input and outputs and optional embedded QWidget.
The Scene could be saved to file.
The rest similar projects were either not finished, not supported anymore or lacking some features.
https://github.com/paceholder/nodeeditor
I would suggest that you implement it without taking into consideration overlap but with the possibility of overriding how the connecting line is drawn.
It looks like there were some good replies on the Qt forum. I don't think you'll get anyone posting the code for doing the whole lot here.
Perhaps take a look at the Qt demos Graphics View/Elastic Nodes - There is code for the demo that you can use as a starting point, but it is a lot of work to get from there to something like the Blender node editor.
Another node editor to take a look at is SynthEdit or Synth Maker (has a nice one).

3D model files & creating triangle meshes from it

I'm new here. I'm learning C++ yet so I don't have a big knowledge about things ( well, I have a lot of experience with programming but with other languages. I also know how to work with a computer xD ). I decided to start working on a game engine. I know it ain't easy but that's one reason why I want to do it - trying/getting experience is the best way for me to learn.
So, I'm starting with the renderer but I have no idea how could I make a 3D model file which as it says in the name it would have a 3d model and it could be loaded into a triangle mesh in the C++ engine and I could use it with Direct3D. I don't want you to do anything except giving me an idea how to start.
Thank you very much if you decided to read this & help.
This is a great question and rings so true because you are in exactly the same place that I was 3 years ago. I looked around at various applications that I could use to generate 3D content. I didn't want to spend time learning various applications because I wanted to get coding my game engine. I couldn't find anything quick enough to learn to make it worth my while (that was free of charge) so in the end I put some scripts together to create the 3D models (vertex arrays). These developed into a GUI driven interface which developed into my own fully functioning 3D Modelling Tool. Now, after 3 years, my Game Engine is on the back burner and MeshCreator (check out http://www.MeshCreator.co.uk) is now my ongoing project.
You need a way of loading in Vertex arrays. OBJ files (wavefront) are Text Based and fairly easy to read. The output from MeshCreator is also ASCII based and there are details on the website on how to interpret the file format.
The File output from MeshCreator is designed for easy import into any 3D project. You could also look at .OBJ files as they are supported by most 3D apps (including mine). OBJ files can get a little complex though.
In short, you need an easy to use tool. It took me 3 years to write my own so I wouldn't recommend it. Try out MeshCreator, MilkShape 3D and maybe Google Shetchup. Also, there are many sites that have royalty free 3D content that you can use in your projects and many are available in OBJ format.
3D model file formats can be very complicated, mostly in the sheer amount of types of things they can contain (meshes, primitives, curved surfaces, materials, lighting, etc. etc.). Which also means that it can be very hard to come up with your own format too. So, there are really two options here: find off-the-shelf libraries to handle the loading of models; or, pick pre-existing formats and write your own code to load those files (and use a standard editor to create them).
The main problem with using an off-the-shelf library to load the models is often that these libraries are often intimately tied to a particular renderer and usually very complex in the (possible) data structures that are generated when loading the files. So, this is often a better solution only if you are prepared to adopt the renderer of which this model-loading-library is a part of or tied to. There are options like Irrlicht, Ogre3D, Coin3D, etc., which all have reasonable capabilities at loading fairly standard 3D model file formats.
If you are going to pick a pre-existing file format and create the loading code yourself (and thus, tied to your own renderer), then you should pick carefully. The 3ds file format is very widely used and its internal structure is nice and fairly simple, with the advantage that you can easily skip elements that you can't support yet (this is useful when you are incrementally writing your rendering code). Most other formats have similar features (forward and backward compatibility, and ability to skip "unsupported" elements). There are also important open-standard formats, vrml and x3d, that you might want to take a look at. Also, there are some simpler formats associated to some open-source 3D editors like Blender. It is important to have a good 3D editor that can output in a file format that you can load. That's why you shouldn't create your own file format, because you will have a lot of extra work to do, either in creating custom "export" scripts (or plugins) for some 3D editor, or in creating your own editor (a monumental task).
Search around. If you want to base your engine on DirectX, I believe the SDK comes with code samples explaining the basics, like loading meshes.
If you're just learning C++, I'd recommend you start with a much simpler project like making a simple game with an engine like Irrlicht or OGRE, but that's up to you.
I think you need something like obj files. You can find online free files to play with. If you want to generate your own, I think you need some 3D rendering software. You can also search how to parse them and load their content in your programs.

Creating a wxWidgets GUI with multiple stages

There's lots of information about creating different layouts, dialogues, even custom controls. However I've not been able to find out how to create a window that has multiple seperate "stages", like an installer, or many of Visual Studio's project wizards.
I guess it could be done by keeping the information seperate from the controls and updating the information on stage changes as needed, then deleteing everything and recreating the window contents each time, but is this really the only and best way? Are there issues with the window size, layout, etc. that I will need to deal with that don't occur when everything is added in the frames constructor?
wxWizard is a great class, but I would suggest it only when you have linear flow of steps/stages.
I think the best idea for you is to create non-re-sizable (just do not use wxRESIZE_BORDER style) frame and set of classes that create/destroy in-line layout on demand. Another option is to extend wxWizard class and supply more navigation functionality to it, but I have doubt you really need that.