Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
“the windows was slow starting on a fast machine”
This means any of the possible:
a) Using the Ted2Go IDE? (if is something related to the IDE)
b) Compiling speed of a demo? (it’s true that MINGW compilations are slow – however only for usage licence is a great choice)
c) Running speed of a demo? (if the demo runs slow – if it’s not 3D it might be something with event processing (eating CPU cycles) – or if it’s 3D it might be something with the GPU/Directx drivers.How about CPU/RAM usage is it normal? It happened to me once to get a terrible trojan that would boost my CPU usage to maximum.
Still trying to guess any possible solution.
Frustum culling is based on simple collision detection. The math in it are only the means to calculate the shape’s volume and then perform collision detection tests and figure if a point is inside this volume.
Your implementation in terms of frustum culling is right, also you take it to the next level which is about hierarchical organization of the scene. Here you use spaces of fixed size which looks like a grid.
One idea for using space partitioning:
12345678910111213141516171819202122232425262728Without space partitioning:your scene would look like this:sceneobjects = [1,2,3,4,5,6,7,8,9,10]every object is placed in a linear fashionand there's no degree of scene organization.if you want to find which objects are inside the frustumyou would have to waste 10 iterationsWith space partitioning:your scene would look like this:sceneobjects =["A" : [1,2] ,"B" : [3,4,5] ,"C" : [6,7,8] ,"D" : [9,10] ,]now if you imagine that the frustum hits spaces A + Byou would simply iterate these two spaces and collectthe objects found in them.This way of splitting up the scene would work fine in simple terms, I would not see something wrong about it. Most of the gaming industry has settled to nested space partions like binary/quadtree/octree. It means basically that a space contains many other spaces (in terms of hierarchical organization) – resulting to an actual tree structure. Each one is supposed to be an alternative way of managing the data structures. For example imagine that you would travel in a desert (which the environment is in the majority much empty) and then suddenly you would enter a small cave where it has lots of stuff in it. This would be a good case of using nested space partition.
Here is an example of space partitioning:
Java123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345/* OpenProcessing Tweak of *@*http://www.openprocessing.org/sketch/10796*@* *//* !do not delete the line above, required for linking your tweak if you upload again */// Quadtree containers demo// Click to make a point. As soon as more than binSize points are// inside of a quad, it subdivides.// Right-click to resetfinal static float dotSize = 2;final static int binSize = 5;final static color[] colors = new color[4];Box b;FuzzyBin q;DLA dla1;void setup() {size(600, 600);frameRate(30);//smooth();colors[0] = color(127,0,0);colors[1] = color(0,127,0);colors[2] = color(0,0,127);colors[3] = color(127,127,0);b = new Box(1, 1, width, height);q = new FuzzyBin(b, dotSize);dla1 = new DLA(q, binSize);dla1.addPoint(width/2, height/2);}void draw() {q.drawMe();fill(0,0,0,0);if (mousePressed) {if (mouseButton == LEFT) {dla1.addPoint(mouseX, mouseY);ellipse(mouseX, mouseY, 4*dotSize, 4*dotSize);} else if (mouseButton == RIGHT) {q = new FuzzyBin(b, dotSize);dla1 = new DLA(q, binSize);background(255);}}stroke(0);}class Box {float Xl, Yl;float Xh, Yh;final static float zero = 1e-20;Box(float X_1, float Y_1, float X_2, float Y_2) {// Orient so (Xl,Yl) and (Xh,Yh) are min/max extent, respectivelyXl = min(X_1, X_2);Xh = max(X_1, X_2);Yl = min(Y_1, Y_2);Yh = max(Y_1, Y_2);}boolean pointInside(float x, float y) {return x > Xl && x < Xh && y > Yl && y < Yh;}// Compute the intersection of the given ray (where x=R0x+Rdx*t and// y=R0y+Rdy*t) with this box; return two t values, Tnear and Tfar,// which give the entry and exit values of t (> 0)float[] intersectRay(float R0x, float R0y, float Rdx, float Rdy) {float Tnear = -1e30;float Tfar = 1e30;// First, check slab in X.if (abs(Rdx) < zero) {// Ray is parallel to X, but starts outside. Fail.if (R0x < Xl || R0x > Xh) {return null;}} else {float Ta = (Xl-R0x)/Rdx, Tb = (Xh-R0x)/Rdx;float T1 = min(Ta,Tb);float T2 = max(Ta,Tb);if (T1 > Tnear) Tnear = T1;if (T2 < Tfar) Tfar = T2;if (Tnear > Tfar) return null;if (Tfar < 0) return null;}// Then check slab in Y.if (abs(Rdy) < zero) {// Ray is parallel to X, but starts outside. Fail.if (R0y < Yl || R0y > Yh) {return null;}} else {float Ta = (Yl-R0y)/Rdy, Tb = (Yh-R0y)/Rdy;float T1 = min(Ta,Tb);float T2 = max(Ta,Tb);if (T1 > Tnear) Tnear = T1;if (T2 < Tfar) Tfar = T2;if (Tnear > Tfar) return null;if (Tfar < 0) return null;}// If we have survived this far, the test passed.return new float[] {Tnear, Tfar};}// Divide this box down into 4 quadrantsBox[] quarter() {return quarter(0);}// d = boundary "fuzziness" sizeBox[] quarter(float d) {float Xm = 0.5*(Xl+Xh);float Ym = 0.5*(Yl+Yh);Box[] quads = new Box[4];quads[0] = new Box(Xm-d, Yh, Xh, Ym-d);quads[1] = new Box(Xl, Yh, Xm+d, Ym-d);quads[2] = new Box(Xl, Yl, Xm+d, Ym+d);quads[3] = new Box(Xm-d, Ym+d, Xh, Yl);return quads;}void drawMe() {rect(Xl, Yl, Xh-Xl, Yh-Yl);}}// QuadTree class. Subdivide it at will.class QuadTree {Box b;QuadTree[] children;int level;static final int maxLevel = 8;QuadTree(Box b) {this.b = b;children = null;level = 0;}QuadTree(Box b, int level) {this.b = b;children = null;this.level = level;}// Divide into 4 smaller quadtrees.// If this exceeds the recursion limit, it will just return null.QuadTree[] divide() {if (children == null && level < maxLevel) {children = new QuadTree[4];Box[] b2 = b.quarter();for(int i = 0; i < 4; ++i) {children[i] = new QuadTree(b2[i], level + 1);}}return children;}// Draw - recursively - the entire quadtree.void drawMe() {b.drawMe();if (children == null) return;for(int i = 0; i < 4; ++i) {stroke(colors[i]);children[i].drawMe();}}boolean isDivided() {return children != null;}// Find the smallest of the child quadtrees which contains the given point.// If none are found, return null. This won't subdivide any further.QuadTree getSmallestIntersect(float x, float y) {if (children == null) {if (b.pointInside(x,y)) {return this;}else {return null;}}for(int i = 0; i < 4; ++i) {QuadTree q = children[i].getSmallestIntersect(x, y);if (q != null) {return q;}}return null;}}// Basically QuadTree class, but with fuzzy boundaries.class FuzzyQuadTree extends QuadTree {float delta;FuzzyQuadTree(Box b, float delta) {super(b);this.delta = delta;}FuzzyQuadTree(Box b, int level, float delta) {super(b, level);this.delta = delta;}// Divide into 4 smaller quadtrees.// If this exceeds the recursion limit, it will just return null.QuadTree[] divide() {if (children == null && level < maxLevel) {children = new QuadTree[4];Box[] b2 = b.quarter(delta);for(int i = 0; i < 4; ++i) {children[i] = (QuadTree) new FuzzyQuadTree(b2[i], level + 1, delta);}}return children;}}// A FuzzyQuadTree that can contain points in each quad.class FuzzyBin extends FuzzyQuadTree {ArrayList x_points = new ArrayList();ArrayList y_points = new ArrayList();FuzzyBin(Box b, float delta) {super(b, delta);}FuzzyBin(Box b, int level, float delta) {super(b, level, delta);}// Add a point to this quad if it's inside, _and_ to any other child// quads that contain it. Return the undivided child quads which// contains it.// If this point is outside of the quad, return null.ArrayList addPoint(float x, float y) {ArrayList tips = new ArrayList();if (b.pointInside(x, y)) {x_points.add(x);y_points.add(y);// We've hit an undivided quad; we're done.if (children == null) {tips.add(this);return tips;}for(int i = 0; i < children.length; ++i) {FuzzyBin c = (FuzzyBin) children[i];ArrayList tips_new = c.addPoint(x, y);tips.addAll(tips_new);}}return tips;}int countPoints() {return x_points.size();}// Divide into 4 smaller quadtrees.// If this exceeds the recursion limit, it will just return null.// Any points contained are passed on.QuadTree[] divide() {if (children == null && level < maxLevel) {children = new QuadTree[4];Box[] b2 = b.quarter(delta);for(int i = 0; i < 4; ++i) {children[i] = (QuadTree) new FuzzyBin(b2[i], level + 1, delta);for(int j = 0; j < x_points.size(); ++j) {FuzzyBin f = (FuzzyBin) children[i];// Note that addPoint will only add it if it actually belongs.f.addPoint((Float)x_points.get(j), (Float)y_points.get(j));}}}return children;}// Return an ArrayList of undivided quads (they'll be FuzzyBin objects)// which the given ray passes through and which are not empty (that is,// they contain some points inside that this ray could conceivably hit).ArrayList intersectRay(float r0x, float r0y, float rdx, float rdy) {ArrayList bins = new ArrayList();// If this quad is empty, we're done.if (countPoints() == 0) return bins;// This quad has stuff in it. Do we intersect it?float[] hit = b.intersectRay(r0x, r0y, rdx, rdy);// If we don't hit it, we're done.if (hit == null) return bins;// Does it have children we can hit?// (That doesn't sound right, does it.)if (children == null) {// If not, we're done _and_ we have a result.bins.add(this);}else {// Otherwise, recursively see which children this ray hits.for(int i = 0; i < children.length; ++i) {FuzzyBin f = (FuzzyBin) children[i];ArrayList bins_new = f.intersectRay(r0x, r0y, rdx, rdy);bins.addAll(bins_new);}}return bins;}// This function could be made much more clever be looking at the actual// entry and exit points (which Box.intersectRay returns) since there are// a lot of cases where it's obvious that it is impossible for an intersection// to occur, but I don't feel like applying this.}class DLA {FuzzyBin bin;int binSize;DLA(FuzzyBin bin) {this.bin = bin;binSize = 10;}DLA(FuzzyBin bin, int binSize) {this.bin = bin;this.binSize = binSize;}void addPoint(float x, float y) {// Two things happen here:// (1) We add the point to the bin.// (2) We make sure that every undivided quad contains at most// binSize points inside (i.e. we divide some if needed).ArrayList f = bin.addPoint(x, y);for(int i = 0; i < f.size(); ++i) {FuzzyBin bin = (FuzzyBin) f.get(i);if (bin.countPoints() > binSize) {bin.divide();// Uncomment this to see them as they are added.//bin.drawMe();}}}}You can look at the OGRE source to see the Octree implementation. In Doom/Quake you can see the BSP implementation.
Sprites are considered to be 2D objects lying around on the 3D space , planes are real 3D meshes on the other hand.
In real OpenGL terms, their implementation is exactly the same. Imagine however that if you used only planes and you wanted to be presented as sprites you would have to iterate all of them and apply the matrix transformation (costs CPU time). Sprites do this transformation right from inside the shader and for that saves CPU time.
Nice idea.
This reminds me of the CMAKE gui where you place the variables you want.
Due to Visual Studio getting updated here and there, you will have to set the correct versions in the configuration file as well.
MX2_MSVC_TOOLS_DIR=${MX2_MSVC_DIR}\Tools\MSVC\14.xx.xxxxx
Go to this directory and see the version (there should be one folder with a name 14.etc.etc):
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVCMX2_WINDOWS_KIT=10.0.xxxxx.x
Open this file and see what version it says on the PlatformIdentity field:
C:\Program Files (x86)\Windows Kits\10\SDKManifest.xmlAlright thanks, now the building started nicely.
These are the correct settings:
123456789MX2_USE_MSVC=1MX2_ARCH_WINDOWS=x64'WAS: MX2_MSVC_TOOLS_DIR=${MX2_MSVC_DIR}\Tools\MSVC\14.13.26128MX2_MSVC_TOOLS_DIR=${MX2_MSVC_DIR}\Tools\MSVC\14.14.26428'WAS: MX2_WINDOWS_KIT=10.0.16299.0MX2_WINDOWS_KIT=10.0.17134.0Mingw uses the GCC compiler (g++ version 4.7 if remember) and Visual Studio the Visual C++ 2017. In each case the binary executable will be always the same because the compilers will produce the same result.
If you can use MSVC2017 on Windows7 then you won’t have any problems.
If you want to use Linux you can develop anything you want – Monkey2 would have greate cross platform compatibility (provided that you won’t use Win specific libraries such as ms_text_to_speech_api_etc) – but the final build and testing would have to be done in a real Windows machine so you can double check and fine tune the details.
You could search for books that refer to object oriented programming theory and design patterns. Other than that any code example you see (in github or the bananas folder) more or less contains everything you would be interested in, on how to use the language syntax. Unfortunately these things I say don’t help much but it’s something that has sense to it.
Currently I have an Intel i5 2320, the GPU is GTX 650. The system was setup years ago, back in 2011. I am still very happy with it. However the GPU suffers really bad and can’t be pushed. For example I tried Fallout 4 or Far Cry Primal and they are very slow. Most importantly I am a Blender 3D user, I won’t be able to transition to the new version with it. By testing out the EEVEE beta I see that it runs slow enough to be annoying.
Yes, you can sell the software you make. Regarding it’s status, the language is pretty much is stabilized, ready for production.
Oh, also I see this message:
IContainer is not a ‘real’ interface because Monkey2 does not yet support generic interface methods. This feature is planned for a future version of monkey2.
The interface is unimplemented now, we’ll see about it in the future.
Good catch, interesting program.
Which model is it?
https://www.cpubenchmark.net/high_end_cpus.html
However I see that Ryzen processors under 200$ have very good performance. Combine this with a 200$ GPU and you’re ready to go.
Initially you would start with a price target in your mind and then see how you can adjust to the market response. Another approach for pricing is to see what others are offering, and try to see how you can fit into the picture. You can place any crazy price you want, but it all boils down to the point if someone is interested to purchase it, which depends on the quality and the usefulness of the project.
If for example the project is fixed and the point is to take it and use, it might be of interest to those people that are only interested in packaging (copy-cat-developers) or for example if it’s purpose is to be component based that is supposed to be easy to be mutated and used and it’s assets to be replaced (game is re-skinned) easily.
P.S. I am not against copy-cat-development, I am against the aggressive ADS that going on there. For example if the game makes you loose within 3 seconds in order to watch 30 sec AD it means that something goes wrong.
 - 
		AuthorPosts