[QUOTE=Mechanical43;52303007]how do you guys feel about kotlin in general?[/QUOTE]
It's Java without the "I'm writing Java, where is the nearest noose" feeling, so pretty good. It's also very similar to Swift which makes it nice for new people getting into android/iOS dev.
[QUOTE=Mechanical43;52303007]how do you guys feel about kotlin in general?[/QUOTE]
Love it. It doesn't blow me away but it just works and it never gets in my way, other than always writing "Type varname" out of habit instead of "val varname: Type".
The syntax is very straightforward, so it's easy to follow. It has all the cool little boilerplate killers like the ?. and !!. operators. You can extend functions(don't think you can in Java). Lambdas and mapping is nice to have, I love being able to strike out a parameter you won't be using with an underscore. Also I love they way you insert a variable in to a string "The number 4: $four".
[editline]2nd June 2017[/editline]
Plus it just works well for Android development, example:
[code]
override fun onNavigationItemSelected(item: MenuItem): Boolean {
// Handle navigation view item clicks here.
when (item.itemId) {
R.id.nav_flashcard -> {
// Handle the flashcard action
}
R.id.nav_game -> {
}
R.id.nav_setting -> {
}
R.id.nav_share -> {
}
R.id.nav_send -> {
}
}
return true
}
[/code]
[QUOTE=r0b0tsquid;52299344]The only place I've seen dependency injection is in this talk
[video=youtube_share;E8I19uA-wGY]http://youtu.be/E8I19uA-wGY?t=1817[/video]
He uses partial function application to capture the dependencies in a closure and return the non-depending type. FP is really beautiful, I want to learn more about it.
Not sure why you would need/want a framework for this? :v:[/QUOTE]
I'm very familiar with DI in a FP setting and this passing parameters and then using the partially applied functions later gets pretty tedious. Haskell, at least, has a solution there in a form of effects. An effect is basically "what can I do in the context I'm currently running in". Your functionality lives in functions that state what kind of effects they need to run. The difference between this and the partial application approach is that a function A with effects (E1, E2, E3) can call a function B with effects (E2, E3) without explicitly passing anything to it because B does a subset of effects of A. If you instead want to call a function that does more than A does, you'll need to update the A's signature to expand it's effects.
One weird thing about Kotlin is that it has no static members. Instead you can create "companion objects"
Here's a practical application of mine with a static member.. I mean companion object.
[code]
class TTS(_context: Context, _locale: Locale) : TextToSpeech.OnInitListener, UtteranceProgressListener() {
private val context: Context = _context;
private val locale: Locale = _locale;
private companion object inst { //static
public var tts: TextToSpeech? = null;
}
init {
if (inst.tts == null)
inst.tts = TextToSpeech(context, this)
else
setLocale();
}
fun setLocale() {
try {
inst.tts!!.language = locale
} catch (e: Exception) {
val toast = Toast(context);
toast.setText(context.getString(R.string.tts_error))
toast.show()
}
}
//onInitListener
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun onInit(status: Int) {
when(status) {
LANG_MISSING_DATA -> notSupportedDialog()
LANG_NOT_SUPPORTED -> notSupportedDialog()
ERROR_SERVICE -> notSupportedDialog()
SUCCESS -> {
setLocale()
//TODO: Activate TTS UI.
}
}
}
//UtteranceListener
override fun onDone(utteranceId: String?) {}
override fun onStart(utteranceId: String?) {}
@Suppress("OverridingDeprecatedMember")
override fun onError(utteranceId: String?) {
//DEPRECATED for 21+, but won't build without at a target API of 16.
}
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
override fun onError(utteranceId: String?, errorCode: Int) {
when(errorCode) {
ERROR_NETWORK, ERROR_NETWORK_TIMEOUT -> {
val toast = Toast(context);
toast.setText(context.getString(R.string.tts_networkerror))
toast.show()
}
ERROR_SYNTHESIS, ERROR_OUTPUT -> notSupportedDialog()
}
}
public fun notSupportedDialog() {
val view = context.inflateLayout(R.layout.dialog_ttsinfo, null)
AlertDialog.Builder(context)
.setView(view)
.setTitle("TextToSpeech Not Supported")
.setPositiveButton(context.getString(R.string.ok),
{ _: DialogInterface, _: Int ->
//TODO: Nav to Google TTS
}
)
.create()
.show()
}
public fun speak(text: String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if(locale != inst.tts?.voice?.locale) {
inst.tts?.language = locale
}
inst.tts!!.speak(text, QUEUE_FLUSH, null, UUID.randomUUID().toString())
}
else {
val toast = Toast(context);
toast.setText(context.getString(R.string.tts_api_errormsg))
toast.show()
}
}
}
[/code]
Actually the companion keyword is useless here since it's private, I just like how it sounds. The companion keyword lets you call the objects members from the class. e.g. [code]TTS.tts [/code]Without the companion keyword an object is still static but you would access it from the instance. e.g. [code]instance.inst.tts[/code]
[editline]2nd June 2017[/editline]
Now that I think about it, I should have just linked the docs.
[url]https://kotlinlang.org/docs/reference/object-declarations.html#companion-objects[/url]
The "2017 Khronos UK Vulkanised" presentations have been released, [URL="https://www.khronos.org/developers/library/2017-khronos-uk-vulkanised"]link[/URL]. I thought this one about things found [URL="https://www.khronos.org/assets/uploads/developers/library/2017-khronos-uk-vulkanised/005-Vulkanised-Dean-Sekulic-Getting-Serious-with-Vulkan_May17.pdf"]porting to Vulkan (for PC)[/URL] was the most interesting, but [URL="https://www.khronos.org/assets/uploads/developers/library/2017-khronos-uk-vulkanised/006-Vulkanised-Bringing-Vainglory-to-Vulkan_May17.pdf"]this one[/URL] about challenges on mobile has some rather bemusing bugs.
Infinity: Battlescape just decided to give up on Vulkan - after investing months of dev time into it, unfortunately. I asked on their FB and apparently they ran into issues with the SPIR-V compiler:
[quote]The shader compiler toolchain is too immature. For example you have to jump through hoops to run an optimization pass on your shaders. Lastly there are shaders that work fine in d3d11/12 with strict IEEE precision but we've been unable to get working in Vulkan due to an inability to force strict IEEE precision.[/quote]
They mentioned that the choice was due to issues rendering their planets, so I'm guessing they're having precision issues rendering at large scales. Which is interesting, because that suggests they aren't using some of the other tricks one can pull to render fuckhuge things without getting jitter or rounding errors I guess. But, what the hell do I know - I'm not a terribly skilled developer or a real dev by any means. Trying to figure out renderpasses and multipass rendering is breaking my head, and I haven't had the energy after work (release soon oh fuck) to kill myself with graphics programming as of late. And somehow I broke secondary command buffers in Vulkan (again, actually), but only when submitting one of the three secondary buffers I submit per frame. I did start pooling all the three allocations I do per mesh into one allocation, though, so that's been nice. Still procrastinating writing my own allocators, though.
[editline]edited[/editline]
I do think Vulkan drivers could use some optimization, it seems there are some common gripes from devs about the drivers. Its still a young API though, so I imagine that'll get better with time. And some of the extensions should be just made part of the base API imo
[editline]edited[/editline]
stolen from /r/cpp, but just found this rather interesting interview with [URL="http://opensourceforu.com/2017/06/bjarne-stroustrup-interview-i-built-c-primarily-for-myself-colleagues/"]Bjarne Stroustroup about C++[/URL] (help i can't stop procrastinating)
I'm working on implementing a level editor into my engine.
Back 3 years ago when I started this project the whole engine was built around a level editor, but functionally it was a POS and required QT; I dumped all of that when I rebuilt the engine from scratch using GLFW.
Does anyone remember the name of a small lightweight UI library that was posted in here a while back? It was perfect for rapid prototyping and could be tied into OpenGL + GLFW projects.
I could build yet another UI system from scratch, but I don't want to reinvent the same wheel again for the 3rd time, mainly because I need to make a bunch of different 'Properties' widgets to manipulate different level entities.
[QUOTE=Radical_ed;52257202]one down, one to go
[IMG]https://my.mixtape.moe/gijbwx.gif[/img][/QUOTE]
Was this the intended pattern?
[img]https://i.kinja-img.com/gawker-media/image/upload/s--spZGPukO--/c_scale,fl_progressive,q_80,w_800/1304167902385354412.jpg[/img]
[QUOTE=Karmah;52305177]I'm working on implementing a level editor into my engine.
Back 3 years ago when I started this project the whole engine was built around a level editor, but functionally it was a POS and required QT; I dumped all of that when I rebuilt the engine from scratch using GLFW.
Does anyone remember the name of a small lightweight UI library that was posted in here a while back? It was perfect for rapid prototyping and could be tied into OpenGL + GLFW projects.
I could build yet another UI system from scratch, but I don't want to reinvent the same wheel again for the 3rd time, mainly because I need to make a bunch of different 'Properties' widgets to manipulate different level entities.[/QUOTE]
"[URL="https://github.com/ocornut/imgui"](dear) imgui[/URL]", probably. I've been meaning to implement it in my personal projects, but its used in vectoraygen and I've found it lovely to work with, compared to things like Qt (which have their place, but this is so much lighter). It can take a bit of getting used to since its different than most other UI libraries, but hey its fast, lightweight, and easy to modify so not exactly a downside
[editline]2nd June 2017[/editline]
have the words "this is such a cool GUI library?" been uttered before because I may have just said them while looking through the examples and running the demos
[QUOTE=paindoc;52305348]"[URL="https://github.com/ocornut/imgui"](dear) imgui[/URL]", probably. I've been meaning to implement it in my personal projects, but its used in vectoraygen and I've found it lovely to work with, compared to things like Qt (which have their place, but this is so much lighter). It can take a bit of getting used to since its different than most other UI libraries, but hey its fast, lightweight, and easy to modify so not exactly a downside
[editline]2nd June 2017[/editline]
have the words "this is such a cool GUI library?" been uttered before because I may have just said them while looking through the examples and running the demos[/QUOTE]
Imgui is the one, thanks
[B]Edited:[/B]
It took me a few hours but I managed to get it incorporated into my project and functioning.
We've graduated from making our own UI libraries now? WAYWO will never be the same.
[QUOTE=reevezy67;52307054]We've graduated from making our own UI libraries now? WAYWO will never be the same.[/QUOTE]
We'll always have the opengl/vulkan triangle
[QUOTE=reevezy67;52307054]We've graduated from making our own UI libraries now? WAYWO will never be the same.[/QUOTE]
I'd roll my own this time around if I didn't need a shitload of different I/O widgets,
oh don't you worry guys i'm actually working on a ui library right now
[QUOTE=paindoc;52305348]"[URL="https://github.com/ocornut/imgui"](dear) imgui[/URL]", probably. I've been meaning to implement it in my personal projects, but its used in vectoraygen and I've found it lovely to work with, compared to things like Qt (which have their place, but this is so much lighter). It can take a bit of getting used to since its different than most other UI libraries, but hey its fast, lightweight, and easy to modify so not exactly a downside
[editline]2nd June 2017[/editline]
have the words "this is such a cool GUI library?" been uttered before because I may have just said them while looking through the examples and running the demos[/QUOTE]
Dear imgui is pure love.
Dear imgui really does look fascinating. I'm actually very curious to see just how well it would work for one of my C++ projects (dll injection, mostly) that always lack a GUI and instead utilizes the console.
As silly as it may sound, has anyone tried using it in a C# project? It seems incredibly useful for building GUI stuff at runtime rather than designing it in Winforms or WPF. One of the biggest setbacks I have with the type of programs I make is being forced to design everything ahead of time, even though it really should be dynamic and easy to edit, if that makes sense.
[QUOTE=CarLuver69;52308827]Dear imgui really does look fascinating. I'm actually very curious to see just how well it would work for one of my C++ projects (dll injection, mostly) that always lack a GUI and instead utilizes the console.
As silly as it may sound, has anyone tried using it in a C# project? It seems incredibly useful for building GUI stuff at runtime rather than designing it in Winforms or WPF. One of the biggest setbacks I have with the type of programs I make is being forced to design everything ahead of time, even though it really should be dynamic and easy to edit, if that makes sense.[/QUOTE]
There's even a C# port I think, check the links page in the github wiki. I'd link it directly but I'm on a phone so bit of a hassle. Not sure how complete /well maintained the port is tough.
[QUOTE=JWki;52309051]There's even a C# port I think, check the links page in the github wiki. I'd link it directly but I'm on a phone so bit of a hassle. Not sure how complete /well maintained the port is tough.[/QUOTE]
[url]https://github.com/mellinoe/ImGui.NET[/url]
Seems to be semi-maintained, and ported by a guy at Microsoft, so probably at least half-decent.
[img]https://www.helifreak.club/image/20170604054139891.png[/img]
Seems like maybe the cue sheet parser has a bug somewhere.
Dear ImGUI is nice from an api perspective, but its lacking a lot of useful functionality that you'll have to work around. Its good for basic stuff, but you will be reimplementing things (which isn't *too* bad) if you step outside the boundary of what it provides, which is fairly narrow
[QUOTE=Icedshot;52310663]Dear ImGUI is nice from an api perspective, but its lacking a lot of useful functionality that you'll have to work around. Its good for basic stuff, but you will be reimplementing things (which isn't *too* bad) if you step outside the boundary of what it provides, which is fairly narrow[/QUOTE]
Hmmm I haven't found it to be narrow in what it provides, care to give an example of some useful functionality you were missing?
[QUOTE=Icedshot;52310663]Dear ImGUI is nice from an api perspective, but its lacking a lot of useful functionality that you'll have to work around. Its good for basic stuff, but you will be reimplementing things (which isn't *too* bad) if you step outside the boundary of what it provides, which is fairly narrow[/QUOTE]
I mean working on nodegraph stuff for another project is probably going to be fairly difficult, but while libraries like Qt are much more powerful they're much weightier and have a lot of what feels like "bloat". There's not a lot to build or iterate upon since its already so developed, where Imgui feels more like a nicely minimalistic set of GUI building tools.
I'm also partial to the contrast of what I have to use Qt for at work, which is quite nice.
[video=youtube;b9cPeRXhIU8]https://www.youtube.com/watch?v=b9cPeRXhIU8[/video]
Working on revamping the metrocop ai. I want them to kinda stand out from the soldiers, which in my mod are pretty aggressive.
i made a quake 3 bsp loader (except textures)
[img]http://i.imgur.com/euPgXSr.png[/img]
p.s. guess the map
[QUOTE=vombatus;52311187]i made a quake 3 bsp loader (except textures)
[img]http://i.imgur.com/euPgXSr.png[/img]
p.s. guess the map[/QUOTE]
Bloodrun ofc
[editline]4th June 2017[/editline]
I recognize that plasma run wall anywhere
now that i'm graduating from uni i've decided i'm just gonna go hardcore into making games. even if i dont make a cent from my projects i'll still have some pretty sweet stuff for my portfolio. got a grand idea for a game but i can already feel the scope being way to big and i haven't even started designing it yet.
[editline]5th June 2017[/editline]
do you guys have a set way of designing a project before you start, or do you just build prototypes and build on them?
[QUOTE=Pat.Lithium;52311309]do you guys have a set way of designing a project before you start, or do you just build prototypes and build on them?[/QUOTE]
I tend to break my idea down into individual game mechanics and putting together small games/tech demos for each to flesh them out a bit. Then I pull them together into a larger project.
But don't listen to me, I've never finished a game haha
[QUOTE=Pat.Lithium;52311309]
do you guys have a set way of designing a project before you start, or do you just build prototypes and build on them?[/QUOTE]
Imo don't try to design a game, but design a mechanic. Something that seems fun to you. Don't worry about the bigger picture because that will all come together during development. You'll find out quickly enough if the mechanic is fun enough to warrant fleshing out.
[QUOTE=Sidneys1;52311316]I tend to break my idea down into individual game mechanics and putting together small games/tech demos for each to flesh them out a bit. Then I pull them together into a larger project.
But don't listen to me, I've never finished a game haha[/QUOTE]
Me too.
Same design strategy, same track record.
[QUOTE=Pat.Lithium;52311309]do you guys have a set way of designing a project before you start, or do you just build prototypes and build on them?[/QUOTE]
I'm in the same boat as you (not knowing what to make), but you know how there's some games you really enjoy playing that just don't go far enough or utilize certain game mechanics that don't feel right? Take for example driving physics, most open-world games these days have arcade slip 'n slide physics that tend to be more suited for people looking to casually drop in and not have to worry about learning how to drive properly.
If I were to make an open-world game like that, one of my biggest priorities would be the driving physics. Once you have a decent "prototype" to start with, the rest kind of falls into place, like Asgard mentioned. Another thing that people might do is a Game Design Document (GDD), but that never really helped me or anyone I know.
If you can't think of anything to do when it comes to making games, I would very strongly recommend not sitting around waiting for that magical idea to come around. Otherwise, you'll probably end up like me and waste a few years not knowing what to do. I've noticed that a lot of game designers tend to be more creative people who have that ability to imagine something and do it. I have a lot of respect for those kind of people, because it's definitely no easy feat. Whereas people like me really want to be game developers, but they're not in any position to create an entire game from scratch. But if a more creative mind asked me to help implement feature X/Y/Z, then I'd definitely have that motivation to get shit done.
Boy that was more than I originally intended to write, but I hope that can be of some help to you. Good luck!
[b]EDIT:[/b]
So I just figured out this is valid C# syntax:
[code][StructLayout(LayoutKind.Explicit, Size = 0xC)]
private struct HierarchyInfoData
{
[FieldOffset(0)]
public VehicleHierarchyInfoData VehicleInfo;
[FieldOffset(0)]
public PropHierarchyInfoData PropInfo;
} HierarchyInfoData m_hierInfo; // notice how we don't need a whole new line for this single-use struct[/code]
It even implies that 'm_hierInfo' is private! Very neat, especially if you like being able to do typedef stuff in C/C++ for single member variables. Unless I missed it, this C# syntax is largely unknown. I didn't even think it'd work!
I kind of like the chaos of multiple people testing discord games in the same channel.
[img]http://i.imgur.com/ZfIaNoZ.png[/img]
It's like numberwang for games.
Sorry, you need to Log In to post a reply to this thread.