Blog

This is my blog, which I will update frequently with interesting information.

Programming language progress

It has been over 5 years, and many people would have presumed I had given up on this programming language. This is not true! I have indeed been working on it in the background; however, real life - such as university studies, and then work - had caught up with me, and required my focus.

 

In the future, I aim to continue this blog post on the programming language, as it is interesting. In the meantime, I will mention a few things that I have worked on:

  • Created a custom lexer, which provides nice(r) output for syntax errors
  • Created a custom parser, which provides nice(r) output for semantic errors
  • Working on a formal-ish Hindley-Milner type system, which would make most typing fairly obvious with type inference
  • Working on handling compile-time executed code. The general concept behind this is fairly simple; however, some work needs to be done to ensure that this works correctly (such as the handling of primitives in the language)
  • Working on the standard library. This needs to be built concurrently as the language is built, as the compiler will need to be able to know certain things i.e. some parts of the standard library may need to be native functions

I would like to make future blog posts on certain concepts which I find interesting throughout the process.

 

The following are milestones I wish to accomplish:

  • To be able to write at least some basic programs in the language (such as a calculator)
  • To be able to handle the problems in Advent of Code

 

A new programming language

Having experienced several programming languages, none seem to suit my specific taste. Java, for example, is incredibly useful for creating programs such as servers, and can run almost anywhere nowadays. On the other hand, it lacks modern features such as properties, which can cause development to be a bit slower.

 

I'd like a language similar to Java, but with features that I have seen from other languages included, such as:

  • Properties and helper functions (C#)
  • Destructors (C++)
  • Functional aspects (Haskell)
  • Easier singletons (Scala)
  • Null type checking (Ceylon)
  • Operator overloading (Kotlin)
  • Easy to use (Python)

Several of these are present in other languages, and there may also be other features I would like. All of this will be decided as I go along, since I will be testing out the language to see if it is usable.

 

My first step is to create the lexer and parser in order to analyse words from a text file. This will ensure some checking can be done before handing over the rest to the interpreter.

0 Comments

Added GUI possibilities

I have added the possibilities for Graphics User Interfaces (GUIs). Currently, it isn't the most well-coded aspect, and I intend to change it in the future, but for now it works.

I have borrowed an image from the game Minecraft from testing purposes. The code works such that the picture displayed does not attempt to scale based upon the size of the window, but rather, the size of the texture. Chances are I will need to improve this system to incorporate both.


Some things to consider:

  • I should add GUI features, such as being able to type inside one, or use a button
  • On the note above, it is becoming increasingly annoying to print screen, crop, and save the picture. A print screen button in-game would be nice
  • I will need to make more complex models. I intend to combine them together, but, that will mean needing to rotate an object around an origin which is not currently its position. I will need to think this over.
  • For the terrain, I have a concept building in my head that will perhaps be costly and daunting, but seems quite favourable. However, I will need to make complex entities first before I can work on the terrain.
  • A glance over textures would be useful, especially for GUIs. Models make be able to get away with basic textures, but GUIs will need special work. Moreover, they need a good way of extending a GUI for flexibility and responsiveness.
  • For some odd reason,entities have problems bouncing, including going through the floor, and finishing the physics abruptly. Again, something to work on.

Game engine physics

I have begun creating the physics for entities. Currently, I am in the process of making a cube bounce, changing only in the Y-axis (for now).


I have also managed to generate my own cuboid. This allows me to define the dimensions, and so allows me some basic customisation for my entities. I will work on defining spheres and other shapes soon. Note that the textures and lighting work too.

Finally, I have also managed to change the code for how the player moves. Still as a cube, the player will now change direction when attempting to move forwards, move backwards, strafe left, or strafe right; specifically, in the camera's direction. Meanwhile, jumping/crouching does not change the player's direction. This solves the problems of swinging the camera to the player's direction and changing the player's direction, by instead simply combining the too and letting the player choose in which direction they wish to go by moving the camera.


Things to consider:

  • I have put restrictions for the control of the camera; however, I would personally like to make this more clever, by detecting collisions. Collision control in general might be what I should next look into.
  • I need to increase the number of hedrons necessary for creating more complex entities. Spheres, cylinders, triangular prisms, etc. will all be needed.
  • I still have not yet created any GUIs. Basic logging GUIs will be useful. Since I am in the debugging stage, GUI buttons may be useful as well, to say e.g. replay an animation.
  • Terrain is going to be a headache, I presume. Currently, it is just flat, which is most likely undesirable. Often a game engine will utilise a height map: an image that dictates the height of each vertex. The problem with this is that I would need to create such a height map, which is both tedious and not efficient for a large map, and that terrain such as caves cause exceptions, as any form of overhang is not possible. Personally, being able to enter/exit a cave without a loading screen or similar concept would be wonderful.

Beginning with the game engine

I have been watching several tutorials and learning OpenGL in order to begin the creation of the game engine. So far, I have successfully been able to understand the concept of depth perception, allowing me to create the possibility of a 3D world, and to generate a simple cube. I have also managed to create the third person perspective, allowing me to rotate around a player.

Things to consider in the future:

  • Currently the player (which is simply a cube for now) moves in the X- and Z-axes strictly. This means that the player moves in a grid like fashion, though this is probably not what I want. I should adapt my code in order to change this.
  • Creating models and textures is quite expensive in reality, as I am simply one programmer and not with a lot of time on my hands. I should probably create a clever way of figuring how to make this easier. At any rate, the easier it is to make models/texture, the more likely and quicker I will be able to add new content to the game.
  • Currently the camera is not clever, and it is possible for the view to glitch through things. Rather than limiting it to a certain number, it's possible that calculating the minimum using the surrounding objects would be better in the future.
  • I should create a GUI soon, as logging information in the console is often annoying. It would be easier to see in a chat box.

So, which language?

One project I would like to do would be to make my own MMORPG. It would be an extremely arduous, and incredibly ambitious, but also a great learning experience in regards to what components make up such a game.


One thing I would have to do is choose in which language I would prefer to program in. The following are most likely the best suited candidates:

  • C++
  • C#
  • Java 

Out of the three, I would say that Java is my strongest language. There are also a more limited amount of gaming resources for Java, compared to C++ and C#, and so by creating a good game in Java I feel I will benefit more due to the greater difficulty in optimising the game.


I will begin creating the game engine for the game, as that is one of the major parts of this project.

First blog post

Here is my first blog post. Hopefully it gets the ball rolling.

I've decided to create a website as a profile portfolio. Hopefully it is easily navigable.