« first day (2144 days earlier)      last day (2879 days later) » 

Jon
4:04 PM
@MickLH you should make another song
channel your inner child
only takes you 10 minutes
lol
 
I'm trying to get a day where my mood isn't at all diluted by bull crap so that I can address what you brought up before
 
Jon
ah well it would be cool if you did, i'll send you 100$
lol
 
I can send you worse versions if it will motivate you that the random source is outputting entropy :P
I guess what I really mean is, maybe my opinion is too tight but when I give someone something against my opinion and they use it I always fucking cringe like damnit there was a better thing to figure out
 
4:23 PM
@BlueBug language?
But generally, yeah, hiding it does the trick. However, you can hack something "better" together, but that depends on the language you are using
 
Jon
5:01 PM
I toned down the verbal harrassement my game dished out
 
user92578
aww
 
@NaCl C++ !
 
Any suggestions on how to implement dragging in level editor?
 
Jon
yah, write code to do it
 
user92578
Set starting point on mouse down, calculate delta (how much the mouse is inside the object), render object to (mousePos + delta) while the mouse is held
 
5:10 PM
@BlueBug several ways to resolve this
 
YES!
power of C++!
 
Ty
 
user92578
I gotta say that the interface looks a little ugly to me @BlueBug
 
@Tyyppi_77 agreed
 
what interface?
 
user92578
5:11 PM
Your class interface
 
user92578
Like why not just name the methods differently, as they apparently do a little different things?
 
Jon
a fruit doesn't eat
 
a bit dirty: implement all eat-overloadings as normal virtual function with a different name, leave it empty. Call all those in Fruit's::eat()
 
Jon
the eat function should be the consumer
 
user92578
IDK what you're doing, but something like cherry.eatCherryWithSeasoning(new Pepper());
 
5:12 PM
a bit less dirty: Let the function take an std::tuple or std::vector as parameter
 
@Ali.S Don't worry Ali.S, it's a spaceship! :D It'll be much easier to identify once it's in game with it's proper environment
 
user92578
Because I always eat my cherries with pepper.
 
then you can call it using std::make_tuple(a, b)
 
these do:
http://stuffpoint.com/fruit/image/180192-fruit-fruit-monsters.jpg
 
@BlueBug Thanks for remembering! You're on point on my goal :P
 
5:12 PM
However, you have to know variadic templates, then
 
user92578
Or you can make the base eat(Params* params);
 
or that, although that is not really "modern"
 
user92578
And then create children from Params and add the data you require, and then cast
 
Jon
not sure how i feel about this
 
neither do I
 
Jon
5:13 PM
some guy added theme support to vanilla unity
 
user92578
Well it's the modern version of void pointers
 
Cherries with pepper?!
 
You can use a custom parameter object as well
or make eat an object altogether with template-specialized operator(), which you call in base Fruit function
 
user92578
And why are you using inheritance for this? You can't even call the correct methods trough a base class pointer, so that's why I think the methods should be named differently
 
user92578
5:14 PM
I don't like adding weird custom features to operators
 
U can call correct methods, @Tyyppi_77
 
Jon
i like to write everthing as extensions
 
BaseClass::function()
 
user92578
Not what I meant.
 
@BlueBug need more?
 
user92578
5:16 PM
Fruit* someFruit = new Apple(); someFruit->eat(someValueAppleWants); that doesn't compile.
 
@NaCl I am thinking maybe I should choose that approach to make it less "dirty"
 
user92578
That approach would be renaming the methods IMHO
 
oh it won't of course.
 
Personally, I'd use the template-specialization or the tuple-approach, depending on the specific use-case
 
u mean like... function<A,B,C>(A a, B b, C c)?
but the types are specified in this case. They cannot be something else.
 
user92578
5:18 PM
I'm not sure, but this might be an XY problem
 
NO
 
user92578
What are you actually trying to do?
 
I'm gonna write up a minimal code example
give me a moment
 
^ ok
shader_program.use(projection_matrix, modelView); shader_shadow_program.use(projection_matrix,modelView,shadowMap);
 
user92578
Oh I see
 
5:20 PM
and so on and on...
 
user92578
Those values are uniforms?
 
they are pointers to array(matrix) or texture(shadowMap) or some other stuff...
 
user92578
No but they get passed to the shader as uniforms, right?
 
yes
 
user92578
This is not a very extendable approach
 
5:21 PM
extendable approach?
 
user92578
What if you want to add support for materials? Then you will need to add maybe like 5 more parameters
 
yes
 
user92578
I've not gone into very deep into this stuff, but I would implement that like shader.addUniformValue("mvp_Matrix", modelViewProjection); shader.use();
 
materialShader.use(projection,modelview,uv_texture, material0,material1, ...)
 
user92578
AlphaShader.Parameters["MaskTexture"].SetValue(AlphaMapp);
 
user92578
5:23 PM
That's basically what MonoGame does
 
I do not want to write shader.addUniformValue("mvp_Matrix", modelViewProjection); each time I need to set up the particular shader. I want to call one function that gets the shader program running.
 
user92578
But you can do the setup just once
 
I need to move the setup code here and there because I am keep twicking things.
 
user92578
In your entry function or something similar, you'd call initShader(); that sets the correct uniforms
 
so the values that go to them changes as well.
 
user92578
5:24 PM
And then you just keep calling use(), as the uniforms are stored as pointers, and are updated accordingly
 
I understand your point.
 
user92578
You'd want shaders, that are content, not actual code, to be as dynamic as possible
 
user92578
If you end up adding a new uniform to a shader, you have to change all the method declarations
 
user92578
That means bigger recompilations, as header files are changed
 
you mean do something like this? * wraped(){ uniform(id_00, apple); uniform(id_01, banana); uniform(id_02, cherry);} *
 
user92578
5:27 PM
Instead of just adding one new attribute line to a source file
 
user92578
I'm not sure what you mean by that, but probably not
 
Jon
still no idea why webGL just opts to distort my level preview images.
works in every other build.
 
user92578
I mean overloads like Shader::setUniform(std::string name, glm::mat4 matrixValue), Shader::setUniform(std::string name, glm::vec4 vectorValue) and so on
 
user92578
You would then just call shadowMapShader.setUniform("shadowMapTexture", shadowMap);
 
now I want third value what should I do?
create a new method? shadowMapShader.setUniform2("shadowMapTexture", shadowMap, othermap);
 
user92578
5:29 PM
shadowMapShader.setUniform("otherShadowMap", otherMap);
 
user92578
You would probably keep a map/list of the uniform values set in the shader
 
user92578
Instead of just single values
 
user92578
These calls aren't overloading anything, they're adding new values
 
user92578
your shader would have a std::map<std::string, type> for each uniform value type
 
user92578
In use or someplace else, you would then iterate over each container, calling the appropriate glUniform* functions on the data
 
user92578
5:31 PM
However, this is just how I've handled this before, you might want to do a quick Google search if this approach is used by other people.
 
user92578
11
A: Engine Rendering pipeline : Making shaders generic

Nathan ReedIt's possible to make your shader system more data-driven, so that you don't have so much shader-specific code laying around for uniforms and vertex formats, but rather set them programmatically based on metadata attached to the shaders. First the disclaimer: a data-driven system can make it eas...

 
I disagree with your approach because you don't seem to understand my situation Typpi. You are missing my point. I am talking about initialization. But instead of initializing in a consructor I were initializing within a method. I believe your misunderstand is caused due to the fact that it is a shader.
376
Q: C++ superclass constructor calling rules

levikWhat are the C++ rules for calling the superclass constructor from a subclass one?? For example I know in Java, you must do it as the first line of the subclass constructor (and if you don't an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).

 
user92578
I understand that you are initializing shader data.
 
user92578
(As a side issue, this does not really follow RAII)
 
I am interested in making it simple and clear rather than less ugly and correct.
 
user92578
5:36 PM
Well, as long as you understand the big downside of your approach, the decision is always up to you.
 
user92578
If this is initialization, why not just make the method a constructor then BTW?
 
user92578
ShadowMapShader shadowMapShader = ShadowMapShader(shadowMap, modeMatrix ...);
 
because if I had to initialize something as soon as I declare it, I will need arguments to construct it beforehand. However I need to process other stuff before I initialize it, simply because I do not have the data to feed to the shader.
 
user92578
Well why not just move the shader creation down the line then?
 
I cannot, because I want to have a reference, save it as a member of a class.
 
user92578
5:39 PM
If you need to have an invalid shader instance floating around before actual initialization, you could make it a pointer, and create it once you have the data.
 
Oh yes!
 
user92578
ShadowMapShader* shader; SomeObject object = SomeObject(shader); shader = new ShadowMapShader(object.GetMatrix());
 
I did it!
Dragging!
 
user92578
Nice
 
I do not want to have pointers. I avoid pointers unless it is absolutely necessary, because I do not trust myself to be good enough with pointers. If I really have to, I use smart pointers
 
5:40 PM
I've wondered
 
user92578
Well now we're back to my first point. Rename the method.
 
user92578
shadowMapShader.initializeShadowMap(shadowMap, modelView ...);
 
user92578
that would call back to shader::initialize(modelView); and so on
 
having many methods in a class that initialize different shaders is confusing because you will now then have many-many functions within a single class
 
how to make a preview, I mean for an example in minecraft when you are in crafting item menu when you move your mouse and when the cursor is at some of the items position there is a white box (actually it is a transparent box).. So how can I implement it, I've tryed paintint a square with not 100 opacity, but when I repaint the box disapear..
the effect is not like minecraft's..
 
user92578
5:43 PM
@BlueBug I think essentially invalidating base class methods is even more confusing
 
Actually it is like a cursor
 
user92578
But I think we've come to the end of the conversation. Just as a final note, this is why RAII is a thing.
 
I htink i got the idea
 
@BlueBug okay, just found out that the approach is not different from "tuple", just much more boilerplate to write
So I'll show you the tuple-example then
 
Jon
classic
 
5:45 PM
It is more complicated @Tyyppi_77 because I will need make more functions that help the initialization. I will end up with God_Shader_Class
 
user92578
(You would end up with an easily extendable generic shader class.)
 
keep Class small and sraight forward. Don't squeeze in thousands stuff in it.
 
user92578
It's a code smell if you need multiple points of initialization
 
^
 
user92578
This is again why RAII is a nice principle.
 
Jon
5:52 PM
mmmm, code smells
 
6:06 PM
@BlueBug okay, I got a somewhat decent solution, but please do not use it, it sucks balls in a real deal application and indicates a major design flaw!! Listen to Tyyppi.
 
Jon
going out for a bit -- if you play / test -- ping me with your grievances
 
 
user92578
Oh my god, that's awful
 
user92578
 
Thank you :)
 
user92578
6:08 PM
This weapon has burst mode
 
user92578
Ooh I just noticed, that sprite is awkward
 
what sprite?
 
user92578
the weapon
 
user92578
 
user92578
See? This is much better
 
6:11 PM
No I don't see it
 
user92578
The back hand
 
Oooh
 
@Jon What happened to all the funny fail messages? (You suck, worst player ever and such) :P
 
user92578
1 hour ago, by Jon
I toned down the verbal harrassement my game dished out
 
@Tyyppi_77 For $29.99 You can get the zombie DLC, clear out hordes of zombies with burst mode :P
@Tyyppi_77 oooo I see :P
 
6:18 PM
@TheMuffinCoder should be $59.99, because 4K textures included, so not overpriced
 
@NaCl Preorder now for a complementary cardboard bookmark
 
5/7 would buy
 
user92578
Unless fame and money makes me a greedy bastard, I probably won't make DLCs and instead just update the base game
 
or make a free dlc to keep it clean
 
user92578
Well why not just update the game then?
 
user92578
6:22 PM
(I don't actually know about any of this stuff and I'm not even released yet, so it's a weird talk)
 
to keep it clean
@BlueBug u dead?
 
I hope I don't get trolled when I'm halfway done with the client that the js 2D canvas is too slow for what I have planned
Based on what I seen with slither.io and diep.io, it can handle lots
 
6:46 PM
Thanks, didn't now about diep.io
 
wow, making 2d tile level editor isn't that easy
Maybe because I'm using Java without Eclipse's addon windowBuilder
 
user92578
Oh yeah, I spent months working on my level editor
 
user92578
It's really cool now and definitely worth it
 
Can you post screenshot?
 
user92578
Sure
 
6:50 PM
I saved myself by not having a game with level design :P
Just gotta spawn random asteroids and planets
 
It depends on what game you are making
 
true true
 
user92578
 
user92578
It's a little more than just a basic tile placer
 
Well, your level editor is huge
I have a question
How did you made
that box
light blue one
which is used for preview (cursor preview)
 
user92578
6:53 PM
Oh the cursor tile, that's just a sprite I drew
 
YES
I've tryed to make something like that on 3 ways, but didn't worked
 
user92578
It's actually a part of a bigger tileset, I have a dynamic bitmasked renderer that can draw any tile sized box with dotted borders
 
When I am moving that tile it left things
and when I repaint() after it, it just dissappear
 
user92578
 
user92578
Like I can also draw a bigger box like that
 
6:54 PM
oooh
but when you are moving it
it doesnt leave things
for now
:D
 
user92578
Oh yeah, you gotta start somewhere
 
user92578
My level editor is ingame, for easier testing
 
If I tell you how much time I am working on it you will kill someone :D
 
user92578
:)
 
around 4 hours
 
user92578
6:56 PM
That's not bad
 
But it can't load sprites still
there are a lot of things to do on it
It is interesting how I will cut different tiles from loaded image
and to put them..I got an idea, something like that:
grassTile = image[0];
waterTile = image[1];
..
 
user92578
Yeah, I've had all that stuff ready, as the editor is integrated into the game and will just use the foundations already there
 
What do you use for GUI?
 
user92578
What I'm kinda wondering is why you're making your own level editor? Do the ready made ones not fulfil your requirements?
 
Have you made your own GUI library or you are using existing one?
 
user92578
6:58 PM
@sn0k3 It's my own code, the same code that renders the menu UIs and game HUDs
 
aha
Well, that is interesting question..
I just wanted to make my level editor
 
user92578
Aight, that's a solid reason
 
which will help me to edit levels for my game
 

« first day (2144 days earlier)      last day (2879 days later) »